Hundreds of jubilant gay rights advocates have celebrated at New Zealand's parliament as the country became the 13th in the world and the first in the Asia-Pacific region to legalise same-sex marriage.
Politicians voted 77 to 44 in favour of the gay marriage Bill.
People watching from the public gallery immediately broke into song after the result was announced, singing a New Zealand anthem in the indigenous Maori language. Leaders of most political parties encouraged politicians to vote as their consciences dictated rather than along party lines.
Same-sex marriage is currently recognised in the Netherlands, Belgium, Spain, Canada, South Africa, Norway, Sweden, Portugal, Iceland, Argentina and Denmark. Politicians in Uruguay approved a law last week which President Jose Mujica is expected to sign.
In one of several speeches that ended in a standing ovation, bill sponsor Louisa Wall told MPs the change was "our road toward healing."
"In our society, the meaning of marriage is universal - it's a declaration of love and commitment to a special person," she said. She added that "nothing could make me more proud to be a New Zealander than passing this bill."
Since 2005 New Zealand has allowed civil unions, which confer many legal rights to gay couples. The new law will allow gay couples to jointly adopt children for the first time and will also allow their marriages to be recognized in other countries. The law will take effect in late August.
The change in New Zealand could put pressure on some of its neighbours to consider changing their laws. In Australia, there has been little political momentum for a change at a federal level and Prime Minister Julia Gillard has expressed her opposition to same-sex marriage. Some Australian states, however, are considering gay-marriage legislation.
Many people in New Zealand remain vehemently opposed to gay marriage. The lobbying group Family First last year presented a petition to Parliament signed by 50,000 people who opposed the bill. Another 25,000 people have since added their signatures to that petition. "Historically and culturally, marriage is about man and a woman, and it shouldn't be touched," said Family First founder Bob McCoskrie. "It doesn't need to be."
He said same-sex marriage should have been put to a public referendum rather than a parliamentary vote. That might not have changed the outcome, however: Surveys indicate that about two-thirds of New Zealanders favour gay marriage.