On Friday, President Barack Obama fulfilled a 2008 campaign pledge, formally ending the ban. After meeting with Defense Secretary Leon Panetta and Adm. Mike Mullen, the Joint Chiefs of Staff chairman, the president certified to Congress that repealing the ban would not jeopardize the military's ability to fight.
"As commander in chief, I have always been confident that our dedicated men and women in uniform would transition to a new policy in an orderly manner that preserves unit cohesion, recruitment, retention and military effectiveness," Obama said in a statement. "Service members will no longer be forced to hide who they are in order to serve our country."
Friday's milestone was expected to be reached under the repeal law Congress passed in December. But homosexuality has been prohibited in the military since World War I, and for years recruits were screened and questioned about their sexual orientation.
Then-President Bill Clinton relaxed the law a bit in 1993, saying the military could not ask if service members were gay. Gay service members could be discharged only if their sexual orientation became known. That became known as "don't ask, don't tell."
Obama's action means that effective Sept. 20, gay service members will be able to openly acknowledge their sexual orientation. And it opens the door for those discharged over the past 17 years under Clinton's policy to re-apply to the military and possibly serve again.
Jeremy Johnson intends to do just that. The former sailor served for 10 years in the Navy before coming out to his commanding officer in 2007.
Johnson, who has been working with a recruiter for months to return to the service, said he was initially bitter about leaving the Navy. Now, he said, "I'm very excited. I think it's going to benefit a lot of people ... It's been a full roller coaster ride for me."
For Zoe Dunning, Obama's decision was the culmination of a nearly two-decade struggle. The retired U.S. Navy commander won a legal battle to stay in the service after coming out as a lesbian in January 1993. More than 13 years and two promotions later she retired in 2007.
"The day-to-day life of the military will not change," Dunning said in a phone interview from California on Friday. "However, it will change significantly for gay, lesbian and bisexual service members, who no longer have to live in fear that this day may be the day they get fired or investigated."
At Camp Pendleton, Calif., Marine Cpl. Jaime Rincon, 21, said, "No one has to be scared anymore of who they are. We can serve our country and not worry about repercussions."
Rincon, on active duty, said he was heading out with a group of military friends to celebrate.
Repeal of the ban got mixed reviews from Congress, which has been bitterly divided on the issue.
Senate Armed Services Chairman Carl Levin, D-Mich., hailed it as the end of a discriminatory policy.
"Gay and lesbian service members have fought and died for our country and are serving in our military now," said Levin, noting that the policy has required them to conceal their sexual orientation. "There is no way to justify a policy that requires our young men and women in uniform to lie about who they are in order to defend their fellow citizens."
But House Armed Services Committee Chairman Howard P. "Buck" McKeon, R-Calif., criticized the action as flawed and said his panel will vigorously oversee the process as it unfolds.
"I am disappointed the president hasn't properly addressed the concerns expressed by military service chiefs before certifying the repeal," said McKeon. "Their worry that the combat readiness of our force could be placed at risk, particularly those serving on the front lines in Afghanistan and Iraq, must be taken seriously."
Advocacy groups that fought for the change called Friday's decision long-overdue, while opponents said it's a political payoff to left-leaning gay and lesbian activists.
Among military leaders there was initial reluctance from those who worried that repeal could cause a backlash and erode troop cohesion on the battlefield.
But two weeks ago, after reviewing the training of nearly 2 million troops, the chiefs of the military services told Panetta that ending the ban would not affect military readiness. On Friday, officials said they will continue to monitor the process and makes changes as needed.
Pentagon officials said Friday that they will review military policies and benefits during the next 60 days to iron out legal and technical details, including how the repeal will affect housing, military transfers and other health and social benefits.
Clifford Stanley, undersecretary of defense for personnel and readiness, said "there will be zero tolerance for harassment, violence or discrimination of any kind."
In most cases, officials said the guidelines require that gays and lesbians be treated like any other member of the military, and the Pentagon will not set up separate barracks or bathroom facilities based on sexual orientation.
There will be differences, however. Same sex partners will not get the same housing and other benefits as married couples. Instead, they are more likely to be treated like unmarried couples.
Service members may also designate their same-sex partners as beneficiaries for insurance and other benefits -- something they may have avoided earlier for fear it would cause their dismissal.
One of the thornier issues is gay marriage.
An initial move by the Navy earlier this year to train chaplains about same-sex civil unions in states where they are legal was shelved after more than five dozen Congress members objected. The Pentagon says the issue is still under review.
Associated Press writers Amanda Barrett in New York, Brian Witte in Annapolis, Md., Julie Watson in San Diego and Sagar Meghani in Washington, contributed to this report.