The Pentagon on Thursday lifted its ban on transgender service members serving openly in the U.S. military effective immediately, as Defense Secretary Ash Carter cited a need for clearer guidelines and the ability to maximize the military’s all-volunteer force.

Senior military leaders had sought more time to fully develop and implement the complex new rules, arguing that the department was moving too fast, U.S. officials told The Associated Press. The move ends one of the last bans on service in the military.

Speaking at a news conference Thursday, Carter said the move was “the right thing to do.”

According to officials, the service chiefs asked Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, to relay their concerns to Carter. A senior U.S. official told the AP that Carter met this week with his military leaders and heard their concerns.

The officials spoke on condition of anonymity because they weren’t authorized to discuss policy decisions before they were made public.

Under the new policy, transgender individuals will be allowed to enlist in the military, and those already serving can no longer be forced to leave based on their gender identity.

Officials familiar with the new plan said people with gender dysphoria, a history of medical treatments associated with gender transition and those who have had reconstruction surgery may be disqualified as military recruits unless a medical provider certifies that they have been clinically stable in the preferred gender for 18 months, and are free of significant distress or impairment in social, occupational or other important areas. Also, transgender troops receiving hormone therapy must have been stable on the medication for 18 months.

The new rules also give military commanders flexibility, noting that not all cases are the same, the officials said. According to estimates, there are likely several thousand transgender individuals serving in the military.

When the military service chiefs met this week, they said they were concerned that they would be given as little as 45 days to develop an implementation plan for those serving, and another 45 days to put it in place, officials said.

According to defense officials, the military leaders, including Gen. Mark Milley, the Army chief of staff, and Gen. Robert Neller, commandant of the Marine Corps, said that while they weren’t opposed to lifting the ban, they thought the new rules didn’t include enough specifics to guide commanders who will have to make decisions about people in their units.

Last July, Carter said he intended to rescind the ban, calling it outdated. He has long argued that the military must be more inclusive to bring in the best and brightest.

At the time he ordered a six-month study to include extensive medical and scientific research and discussions with other nations and companies with experience in the process. He extended the study because the military wanted more time. Officials said he wanted to insure there was no impact on military readiness, but over time he became frustrated with the slow progress.

The new policy provides broad guidelines for transgender service members. They will be able to use the bathrooms, housing, uniforms and fitness standards of their preferred gender only after they have legally transitioned to that identity, according to officials.

The new rules, however, give commanders the discretion to make decisions on a case-by-case basis, including for job placement, deployments and training delays, based on the needs of the military mission and whether the service member can perform their duty.

The policy also allows commanders to approve certain accommodations when possible, such as when troops are showering. That could include installing shower curtains, towel hooks or allowing transgender troops to shower at different times or wear minimal clothing.

The military policy differs from civilian gender transitions, where transgender individuals often dress, live socially and work full time in their preferred gender during the process. Under the new policy, service members would only be able to do that when off-duty and away from their duty station.

The Associated Press contributed to this report.