Defense Secretary Ashton B. Carter repealed the Pentagon’s long-held ban on transgender people serving in the military Thursday, ending a year-long process that was bogged down by internal conflict and concerns among senior service officials about how the change could be made.

Carter said at a news conference that the policy change will take place over the next 12 months, beginning with guidance issued to current transgender service members and their commanders, followed by training for the entire military. Beginning Thursday, however, service members can no longer be involuntarily separated from the services solely on the basis of being transgender, he said.

“Our mission is to defend this country, and we don’t want barriers unrelated to a person’s qualification to serve preventing us from recruiting or retaining the soldier, sailor, airman or Marine who can best accomplish the mission,” Carter said. “We have to have access to 100 percent of America’s population for our all-volunteer forces to be able to recruit from among them the most highly qualified — and to retain them.”

The decision marks the latest way in which the military has blazed new trails in the last few years on issues that have divided the country. In 2011, the Obama administration  repealed the “don’t ask, don’t tell” policy, which prohibited gay service members from serving openly. Last year, Carter lifted a ban on women serving in units in ground combat assignments.

For decades, the Pentagon considered transgender people to be sexual deviants who had to be discharged from service. The military decided last year to move the authority to discharge to higher-ranking commanders, making it tougher to force out those who came out as transgender. Still, many service members have been living in limbo.

The Pentagon chief said that a Rand Corp. study commissioned by the military found that there are about 2,500 transgender service members among the 1.3 million active-duty members of the military and an additional 1,500 among reserve units.

The “upper end of their range of estimates” found that there are about 7,000 transgender troops on active duty and 4,000 in the reserves, Carter said. Other organizations studying sexuality, such as the Palm Center, have found that there were about 15,500 transgender service members a few years ago and 12,800 now because of  reductions in the overall size of the force.

The decision brought a mixed reaction on Capitol Hill. Rep. Duncan D. Hunter (R-Calif.), a Marine Corps veteran who played a key role in a failed effort five years ago to slow the demise of “don’t ask, don’t tell,” discussed what to do with his staff and decided it was better to focus on other issues, according to his chief of staff, Joe Kasper.

“He’s thought about it. We talked about it,” Kasper said ahead of time when the announcement was imminent. “But he’d likely be alone in the effort. On these issues — most members won’t touch them with a 10-foot pole. Hunter will, but he can’t get others on board.”

Rep. Mac Thornberry (R.-Tex.), the chairman of the House Armed Services Committee, called Carter’s decision the latest example of the Pentagon and President Obama prioritizing politics over policy.

“Our military readiness — and hence, our national security — is dependent on our troops being medically ready and deployable,” he said in a statement. “The Administration seems unwilling or unable to assure Congress and the American people that transgender individuals will meet these individual readiness requirements at a time when our Armed Forces are deployed around the world.”

Thornberry and Sen. James Inhofe (R.-Okla.), a member of the Senate Armed Services Committee, said they would consider legislative options on the subject.

The details of the transgender policy change appeared to strike a compromise between some issues at play. Notably, transgender people who want to join the military will be required to wait 18 months after a doctor certifies that they are stable in their new gender before they can enlist. Defense officials familiar with the discussions have said that the Army and Marine Corps pressed to wait two years, while the Navy and Air Force thought 12 months were sufficient.

Carter, who appeared Thursday without military leaders in uniform alongside him, said the decision to make the change in policy was his. But he added that he tried to build consensus among military officials before forging ahead.

“I have a general principle around here which is that it’s important that people who have to implement decisions be part of the decision-making, and the armed services are the one who are going to have to implement that,” he said. “They’ve been a part of this study, but now they are a critical part of implementation.”

Gen. Robert B. Neller, the Marine Corps commandant, said in a statement that integrating transgender service members will require understanding, coordination and discipline.

“As we develop our implementation plan, we will pay particular attention to maintaining our readiness and standards, while respecting those who share the esprit de corps to serve as Marines,” Neller said. “We fight and win as a team. In that, we will continue to treat all Marines with dignity and respect.”

Cynthia Smith, an Army spokeswoman, said the service will work diligently to develop an implementation plan.

The decision was greeted with jubilation by transgender service members, who have lived in an awkward world over the last year in which Carter noted their difficulties and established a working group to research the issue.

“We all knew the change was coming ever since he acknowledged our service,” said Staff Sgt. Patricia King, a transgender member of the Army infantry who recently was assigned to Joint Base Lewis-McChord in Washington state. Her new unit was prepared for her when she arrived and has treated her warmly, she said.

“All they saw was a soldier and woman ready to do her job,” King said.

Many policy details still need to be decided, however. Over the next 90 days, the Pentagon will follow up by completing and issuing a commanders’ guidebook for leading current transgender service members and medical guidance to military doctors for providing gender transition care if required for those already in uniform. The Defense Department also will immediately initiate changes so that transgender troops can alter their gender in personnel management systems.

Beginning in October, the services will begin training rank-and-file service members about the change. By no later than next July, the military services will begin allowing transgender people who meet all standards to openly join the military, provided that they are considered stable in their identified gender for 18 months, as certified by their doctor and verified by a military doctor.

After Carter’s announcement, the Defense Department released a new 18-page document outlining one of the most complicated issues involved: Swapping genders while serving on active duty. It calls for the Pentagon and the military departments to institute policies by which service members can do so, and states that if a military medical provider determines it is necessary they will receive treatment.

“Commanders will assess expected impacts on mission and readiness after consideration of the advice of military medical providers and will address such impacts in accordance with this issuance,” the document states. It adds that commanders “will not accommodate biases against transgender individuals.”

Carter had progressively faced more pressure from advocates for the ban’s repeal over the last few months. He announced last July that he was forming a working group to study the issue over the following six months, but the deliberations extended for nearly a year as service officials raised a variety of concerns.

Defense officials, speaking on the condition of anonymity in order to discuss internal Pentagon discussions, said after Carter’s announcement that commanders will have significant discretion in making sense of how and when gender transition for a service member will occur, particularly if there is gender reassignment surgery involved.

“Each case is going to be unique, and each piece of treatment is going to be subject to decisions not only by doctors, but by commanders,” one official said.