New Zealand is the first Asia-Pacific nation to legalize same-sex marriage, prompting cheers and singing in the same parliament where sexual relations between men were decriminalized just 27 years ago.
The third and final reading of the Marriage Equality Bill was passed late , 77 votes to 44. Lawmakers and members of the public applauded in the Wellington debating chamber when the result was heard, before singing "Pokarekare Ana," a traditional Maori love song.
Celebrations were held throughout the night in bars and clubs across the country.
New Zealand joins 12 other nations that allow same-sex marriage, including Canada, South Africa and Spain.
Prime Minister John Key voted in favor of the law change, after last May saying he wasn't opposed to gay marriage, shortly after President Barack Obama voiced his support. Key had previously voted against civil unions, which New Zealand legalized in 2005.
The legislation amends 1955 laws to rule that all adults in New Zealand, including those identified as transgender or transsexual, can wed.
New Zealand decriminalized sexual relations between men aged 16 and over in 1986, while such activity between women was not illegal, the Ministry of Culture and Heritage said on its New Zealand History website. Seven years later, discriminating against people on the grounds of their sexual orientation was outlawed, the ministry said.
A New Zealand Herald Digipoll survey conducted last month showed 52 percent of respondents supported same-sex marriage while 48 percent were opposed. The poll surveyed 750 people and had a margin of error of 3.6 percent.