The US House of Representatives has rejected a constitutional amendment banning same-sex marriage, ending the congressional debate on the issue.
Some US states fully recognise same-sex marriages
The motion was backed by 236 to 187 votes - 47 votes short of the two thirds majority needed to advance it.
The bill had already been defeated in the Senate, which blocked it in June.
President George W Bush had backed the amendment. Critics said he was trying to win back disillusioned Republicans for November's mid-term elections.
Supporters said that despite its failure to win the votes it needed, the amendment would still make a difference at the polls.
"The overwhelming majority of the American people support traditional marriage, and the people have a right to know whether their elected representatives agree with them," said Republican Marilyn Musgrave, who sponsored the amendment.
Opponents of the amendment said the proposal was discriminatory and legislatively irrelevant because of the Senate vote six weeks ago.
"This hateful and unnecessary amendment is unworthy of our great Constitution," said Democrat Tammy Baldwin.
The subject of gay marriage has been much debated in the US since Massachusetts became the first state to issue marriage licences for gay couples in 2004.
Forty-five of 50 states have passed laws or amended their constitutions to effectively prohibit same-sex marriages.
But several of those bans have recently been rejected by judges in states, including Washington, California and New York.
A similar ban on gay marriages failed to pass through Congress in 2004.