The announcement -- which removes one of the last barriers to military service by any individual -- was made by Defense Secretary Ash Carter, who had been studying the issue for almost a year.
The decision comes as the military has witnessed major changes in the role of women and the inclusion of gays, lesbians and bisexual service members in recent years.
It drew some criticism from Republicans and conservatives, including Rep. Mac Thornberry, Republican chairman of the House Armed Services Committee, who charged the White House was "prioritizing politics over policy."
Carter said the ending of the ban takes effect immediately and that no longer could a transgender person be discharged on that basis.
Transgender service members will also receive the same medical coverage as any other military member -- receiving all medical care that their doctors deem necessary -- according to Carter.
For current members of the military, the coverage will include hormone therapy and gender reassignment surgery if doctors determine that such procedures are medically necessary.
Incoming service members must be "stable" in gender identity for 18 months before joining the military.
"The Defense Department and the military need to avail ourselves of all talent possible in order to remain what we are now -- the finest fighting force the world has ever known," Carter said Thursday at the Pentagon.
"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. We have to have access to 100% of America's population," he added.
"Although relatively few in number, we're talking about talented and trained Americans who are serving their country with honor and distinction," he said. "We want to take the opportunity to retain people whose talent we've invested in and who've proven themselves."
Praising Thursday's announcement, Aaron Belkin, founder and executive director of the PALM Center, an organization that has advocated for lifting the ban for the past three years, called it a "historic day."
Now people "can serve without having to lie about who they are" and be "provided the medical care they need," he added.
Carter said the decision was "a matter of principle."
"Americans who want to serve and meet our standards should be afforded the opportunity to compete," he said.
Capt. Sage Fox, a U.S. Army Reserve officer who transitioned in 2012, voiced her support for lifting the ban.
"This is about equality, about civil rights ... about recognizing the decency of human beings, that we are all equal and that gender is not a barrier to service," she told CNN.
Fox was not discharged after her transition but was shifted to the Individual Ready Reserve, meaning she could be called back to duty but would not show up for training, draw a paycheck or have access to health benefits.
Lifting the ban will have an impact beyond those transgender people currently serving in the military or those who want to serve, according to Fox.
"It's going to go through and send a message to the rest of the world that the U.S. isn't behind everyone," she said, "that we do care about human rights, that we do care about equality, and we aren't just going to talk about it, we are actually going to do it."
The groundwork to lift the prohibition began last year when Carter said he would study the "readiness implications of welcoming transgender persons to serve openly."
"This has been an educational process for a lot of people in the department, including me," Carter said Thursday, describing his meetings with transgender service members.
Fox, who has maintained an inactive status for the past several years, said she plans to go back into the service now that the ban is lifted and is already in negotiations about returning to the California National Guard.
"I'm excited for the opportunity to start leading troops again and setting an example for others the best I can on how to go through and be a trans woman in uniform and do it right," she said.
Implementation of the policies associated with lifting the ban will begin immediately, but Carter noted that the process would occur in stages over the next year, a timetable that is comparable to the time it took to train the force following the lifting of "don't ask, don't tell," which had banned openly gay, lesbian and bisexual people from serving in the military.
"Simply declaring a change in policy is not effective implementation," Carter said. "That's why we have worked hard on the implementation plan and must continue to do so."
Several voices have been critical of the move, saying that it has come too quickly.
"This is the latest example of the Pentagon and the President prioritizing politics over policy," said Thornberrry, Republican chairman of the House Armed Services Committee.
"Our military readiness -- and hence, our national security -- is dependent on our troops being medically ready and deployable," he added. "The administration seems unwilling or unable to assure the 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."
Family Research Council President Tony Perkins, a Marine Corps veteran, said President Barack Obama was using the military "to fight culture wars."
"This is yet another example of President Obama using America's military to fight culture wars instead of to fight real wars against the enemies of our nation," Perkins said.
"Former Defense Secretary Robert Gates said that 'the only military matter . . . about which I ever sensed deep passion on [Obama's] part was 'Don't Ask, Don't Tell.' Now Mr. Obama has only added to his legacy of misplaced priorities with regard to our country's defense," Perkins added.
At the upper end of the estimates, there are as many as 11,000 transgender active duty service members and reservists who will be affected by the decision, according to a RAND Corporation study cited by the Pentagon.
Carter noted the Pentagon received input from transgender service members and experts and medical professionals outside the department. He also said at least 18 other countries allow transgender members to serve openly.
The move comes after the "don't ask, don't tell" policy was ended in 2011. In 2015, the Family Medical Leave Act was extended to cover all legally married same-sex couples and the Defense Department amended its equal opportunity program "to protect service members against discrimination because of sexual orientation."