Uruguay's legislature voted Wednesday to allow same-sex marriages nationwide, making it only the second Latin American country to do so.
The vote, with 71 of the 92 members of the lower house backing the measure, was welcomed with cries of "freedom, freedom" and "equality" from members of the public who burst into applause.
The senate last week approved a bill legalizing marriage between "two people of different or the same sex."
"Tomorrow, we will have a more just, more equal society with more rights for everyone," said Sebastian Sabini, a lawmaker from the Frente Amplio ruling coalition.
Uruguay's move came after Argentina approved gay marriage in 2010. Same-sex marriage has been permitted in Mexico City, but not the rest of the country, since 2009.
The Catholic Church appealed during Easter week for the defense of the institution of marriage, but only eight opposition senators voted against the bill, while 23 voted in favor.
"Today, the Uruguayan state recognizes a form of love that is different from heterosexual love but just as valid," said Federico Grana of the Ovejas Negras (Black Sheep) collective representing gays, lesbians and transvestites.
"This victory is a victory for all social groups fighting for a fairer and egalitarian society."
An emotional Michelle Suarez, the country's first transsexual lawyer and author of the initial equal marriage bill, expressed "profound joy" at the "substantive" vote.
On May 1 Square in front of the Legislative Palace, dozens of supporters waved rainbow flags, while electronic music played in the background.
"Last night, I could not sleep. I'm very excited," said Roberto Acosta, 62, dressed in gold from head to toe and wearing a hat with gay pride colors.
"It's amazing to fight for so long and to win."
Silvina, who declined to give her last name because her parents do not know her sexual orientation, said that more tolerance was still needed despite the milestone.
"Supposedly, we are a tolerant country. But I had rocks thrown at me just a few weeks ago just for laughing with someone in the street," she said.
"But I do hope this starts to make people aware of things now. At least the legal side of things will be taken care of."
Over the past six years, Uruguay has legalized civil unions for homosexuals and the adoption of children by same sex couples, as well as opened the military to gays.
The new law allowing same-sex marriage also includes other changes that apply to all regardless of sexual orientation, including some concerning divorce, inheritance and adoption.
The minimum age for legal marriage will increase to 16 for all instead of the current 12 for women and 14 for men.
Same-sex couples who adopt will be allowed to choose the order in which a child uses family names.
The new law will take effect 90 days after its enactment.