Wedding bells will ring out over same-sex marriages within weeks after parliament passed historic laws.
The marriage equality laws cleared parliament unchanged on Thursday evening after a marathon debate lasting 56 hours, despite a push from conservative politicians for additional religious protections.
Same-sex couples will be able to lodge formal intentions to wed from this Saturday before getting married from January 9.
Gay couples who tied the knot overseas will have their unions officially recognised as soon as the laws gain royal ascent.
"What a day! What a day for love, for equality, for respect. Australia has done it," Prime Minister Malcolm Turnbull told parliament, just before the bill passed.
Labor leader Bill Shorten said the new law spoke for a modern Australia, "inclusive and fair".
"We are no longer a nation of people who voted no, or people who voted yes - we are simply Australians, one and all," he said.
A packed public gallery applauded and burst into the song I Am Australian.
Only four MPs in the House of Representatives voted against the private bill, a week after the legislation was agreed to by the Senate.
More than 120 MPs spoke on the bill, which was sponsored by gay Liberal senator Dean Smith and backed by colleagues Warren Entsch, Trent Zimmerman, Tim Wilson and Trevor Evans.
"I'd like to dedicate (this) win to a special group of young people and that is those young LGBTI Australians who in their workplace or their schoolyard find life a little tough," Senator Smith said after the vote.
"Let me tell you - you are OK, it will all be OK and this is a great country to grow up and be an LGBTI Australian in."
Under the new laws, ministers of religion and religious marriage celebrants will be able to act in accordance with their beliefs about marriage.
Religious bodies will be able to act in accordance with their doctrines, tenets and beliefs in providing facilities, goods and services in connection with marriage.
Both major parties had given their members a free vote on the issue.
Former prime minister Tony Abbott, Treasurer Scott Morrison, junior ministers Michael Sukkar and Alex Hawke, and backbenchers Andrew Hastie, Andrew Broad and Sarah Henderson, were unsuccessful in trying to change the bill, as was Greens MP Adam Bandt.
Voting against the bill were three coalition MPs - Keith Pitt, David Littleproud and Russell Broadbent - as well as independent Bob Katter.
The names of those who abstained and voted for it were not recorded.