Only four MPs voted against the move.
Australia’s parliament voted overwhelmingly to legalise same-sex marriage on Thursday, prompting celebrations in a country where some states ruled homosexual acts to be illegal until just a quarter of a century ago.
Lawmakers waved rainbow flags and embraced on the floor of the chamber, where earlier in the debate a politician had proposed to his same-sex partner.
The move had won strong support in a nationwide survey. Only four out of 150 MPs voted against it.
"What a day. What a day for love, for equality, for respect," said Prime Minister Malcolm Turnbull. "It is time for more marriages."
The first legal same-sex unions will be celebrated in January. The laws will also recognise same-sex marriages solemnised in foreign countries.
Religious organisations and conservative lawmakers had voiced strong opposition and proposed dozens of amendments, pressing for broad protections for religious objectors, including florists and bankers, to refuse service to same-sex couples.
The amendments were all defeated during three days of debate.
"Love has won, and it's time to pop the bubbly," said Greens MP and same-sex marriage supporter Adam Bandt.