Uruguayan lawmakers voted on Wednesday to legalise gay marriage, making the South American country the third in the Americas to do so.

Supporters of the law, who had filled the public seats in the Senate, erupted in celebration when the results were announced. The bill received the backing of 71 members of the 92-seat chamber.

"We are living a historic moment," said Federico Grana, a leader of the Black Sheep Collective, a gay rights group that drafted the proposal. "In terms of the steps needed, we calculate that the first gay couples should be getting married 90 days after the promulgation of the law, or in the middle of July."

The "marriage equality project," as it is called, was already approved by ample majorities in both of Uruguay's legislative houses, but senators had made some changes requiring a final vote by the deputies.

Among them: gay and lesbian foreigners will now be allowed to come to Uruguay to marry, just as heterosexual couples can, said Michelle Suarez of the Black Sheep Collective.

'Contracting parties'

President Jose Mujica's ruling Broad Front majority, which backed the law, is expected to put it into effect within 10 days.

Nationalist senator Gerardo Amarilla opposed the law, saying it "debases the institution of marriage" and impacts the family, especially in its "role in procreation."

The vote makes Uruguay the third country in the Americas, after Canada and Argentina, to eliminate laws making marriage, adoption and other family rights exclusive to heterosexuals. In all, 11 other nations around the world have already taken this step.

Whereas some other countries have carved out new territory for gay and lesbian couples without affecting heterosexual marrieds, Uruguay is creating a single set of rules for all people, gay or straight. Instead of the words "husband and wife" in marriage contracts, it refers to the gender-neutral "contracting parties."

All couples will get to decide which parent's surname comes first when they have children. All couples can adopt, or undergo in-vitro fertilization procedures.

It also updates divorce laws in Uruguay, which in 1912 gave women only the right to unilaterally renounce their wedding vows as a sort of equaliser to male power. Now either spouse will be able to unilaterally request a divorce and get one.

The law also changes the age when people can legally marry from 12 years old for girls and 14 for boys; people of either gender would need to be at least 16.

Outside congress, gay couples holding hands, transvestites and transgender couples jumped in celebration when the result was announced. People in costumes carrying Uruguayan and rainbow flags danced to electronic music.

"I have all the rights and obligations of everyone else. I pay my taxes and fulfill my responsibilities, why would I be discriminated against?" said Roberto Acosta, a 62-year-old retired gay man.

Mujica, who spent more than a decade in prison for his actions as a leftist guerrilla in the 1970s, and still lives on a ramshackle flower farm in a poor neighborhood on the edge of Uruguay's capital, has pushed for a series of liberal laws recently.

Congress agreed to decriminalise abortion, but he had to table an effort to put the government in charge of the marijuana business, saying society has to reach consensus on that idea first.

Uruguay's Roman Catholic Church asked lawmakers to vote their conscience and challenged the label of "marriage equality" as a false pretext, saying it is "not justice but an inconsistent assimilation that will only further weaken marriage."