MPs and those in the public gallery broke into applause and cheered as it was announced the vote passed with 77 votes to 44.
They then broke into song. After a two-hour debate, MPs were able to have their say on the Marriage Equality Bill.
MPs from both sides of the House lined up to hug the bill's sponsor, Louisa Wall.
She, National MP Tau Henare and Green MP Kevin Hague were presented with flowers.
Those opposed to the bill quietly left the public gallery.
During the two hour debate before the vote, many members had to share their speaking slots with others, so most could have their say.
Among the highlights was Green MP Mojo Mathers, who received a rousing applause, after she told the house how her daughter went to her first formal with her girlfriend last year.