The United States stood on the cusp of letting gays serve openly in its military for the first time, as the US Congress sent President Barack Obama a bill to bring about the historic shift.
Senators voted 65-31 to approve House-passed legislation to repeal the "Don't Ask, Don't Tell" compromise of 1993 requiring gay soldiers to keep quiet about their sexual orientation or face dismissal.
"It is time to recognize that sacrifice, valor and integrity are no more defined by sexual orientation than they are by race or gender, religion or creed," said Obama, who vowed during his 2008 White House bid to lift the ban.
Obama was expected to sign the measure this week with great fanfare, launching a White House and Pentagon certification process to ensure the smoothest possible transition at a time when Washington is fighting two wars.
Eight of the White House's Republican foes backed the change -- perhaps the biggest such shift in the US military since racial integration began in 1948 -- while three Republicans and one Democrat missed the vote.
The measure, its passage assured when it cleared a procedural hurdle by a 63-33 margin earlier, fueled bitterly divisive debate in the already polarized Senate.
"The first casualty in the war in Iraq was a gay soldier. The mine that took off his right leg didn't give a darn whether he was gay or straight. We shouldn't either," Democratic Senator Carl Levin said before the ballot.
"We cannot let these patriots down. Their suffering should end. It will end with the passage of this bill. I urge its passage today," said Levin, who chairs the Senate Armed Services Committee.
"It isn't broke, don't fix it," countered Senator John McCain, the top Republican on Levin's panel and Obama's defeated 2008 White House rival and a fierce foe of lifting the ban.
"To somehow allege that it has harmed our military is not justified by the facts," McCain said. "Don't think that it won't be at great cost."
Passage triggered a time-consuming process that calls for lifting the ban only after the president, the secretary of defense, and the top US uniformed officer certify that doing so can be done without harming military readiness, effectiveness, unit cohesion, recruiting and retention.
Republicans have scoffed that the leaders involved have already stated their support to ending the policy.
"They have already made up their minds," said Republican Senator James Inhofe.
The Pentagon issued a study this month that found a solid majority of troops were not bothered by the prospect of lifting the ban and that the military could implement the change without a major disruption or upheaval.
The repeal effort enjoyed broad support from the US public, as well as from Defense Secretary Robert Gates and US Joint Chiefs Chairman Mike Mullen.
Gates -- who had warned that US courts would step in and perhaps force a hasty end to the policy unless lawmakers acted -- said the Pentagon would "carry out this change carefully and methodically, but purposefully."
Mullen, whose emotional February testimony to Congress in favor of repeal has been credited as a signal moment, said ending the ban was "the right thing to do."
"No longer will able men and women who want to serve and sacrifice for their country have to sacrifice their integrity to do so," he said, promising: "We will be a better military as a result."
Secretary of State Hillary Clinton, whose husband Bill had enacted the "Don't Ask Don't Tell" policy when he was president, said the repeal would strengthen US support for human rights internationally.
"This is a historic step forward for all Americans, a step toward a more perfect union and a more perfect reflection of our core values," she said.
In the years since the ban was enacted as a compromise, some 13,000 US troops have been ousted, and critics have pointed out that many were trained at great expense, like fighter pilots, or had hard-to-find skills, such as Arabic translators.
But opponents of the legislation have cited testimony from US military service chiefs who warned against a quick repeal, citing concerns about unit cohesion.
General James Amos, commandant of the Marine Corps and an opponent of lifting the ban, has warned repeal could jeopardize the lives of Marines in combat by undermining closely knit units.
Newly minted Democratic Senator Joe Manchin and Republican Senators Jim Bunning, Judd Gregg, and Orrin Hatch did not vote on repeal.