Australia is to become the 26th country to legalise same-sex marriage after a landslide vote in the Federal Parliament this afternoon.
Only four MPs in the lower house voted against a private bill on Thursday, just over a week after it was agreed to by the Senate.
It went through unchanged, despite a push from conservative politicians for additional exemptions - including for religious organisations, civil celebrants and Defence chaplains.
Prime Minister Malcolm Turnbull told parliament, just after a round of applause across the chamber and in the public gallery, the legal change belonged to all Australians.
"What a day! What a day for love, for equality, for respect," he said. "Australia has done it.
"It's time for more marriages, more commitment, more love, more respect."
Labor leader Bill Shorten said the new law spoke for a modern Australia, "inclusive and fair".
"When this law is passed, we should declare 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.
Both major parties had given their members a free vote on the issue.
More than 120 MPs spoke during nearly 24 hours of debate 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.
Former prime minister Tony Abbott tried to effectively kill off the legislation with an amendment that would stop its progress, but failed.
Treasurer Scott Morrison, junior ministers Michael Sukkar and Alex Hawke, and backbenchers Andrew Hastie, Andrew Broad and Sarah Henderson, were also unsuccessful in trying to change the bill, as was Greens MP Adam Bandt.
"It's time to pop the bubbly ... because love has won," Mr Bandt said.
The legislation will become law as soon as it is granted royal assent by the Governor-General.
The process could pass in a matter of days, meaning same-sex couples could be tying the knot before Christmas.
Abbott’s attempt to halt bill thwarted
Former prime minister Tony Abbott's amendment to the marriage-equality bill was shut down earlier in the day after members of his own party rallied forces against him.
Veteran Liberal MP Warren Entsch told MPs that agreeing to Mr Abbott's proposed change would have stopped progress of the legislation already voted through the Senate.
"I ask colleagues to remember that Australians have emphatically voted to end discrimination against the LGBTI community, their friends, family and colleagues," he said.
Mr Abbott said he moved the amendment "out of respect for the millions of Australians who take religious freedom seriously".
"Out of respect for the millions who want the SSM bill swiftly passed I chose not to divide on it," he tweeted.
Mr Entsch thanked the 125 MPs who spoke during more than 21.5 hours of debate on the bill, which he co-signed with gay Liberal Senator Dean Smith and three others.
Among the highs and lows was colleague Tim Wilson's historic proposal to his partner Ryan on the floor of parliament.
But Mr Entsch made special mention of the contribution from crossbencher Bob Katter, the last MP to speak on Wednesday night.
"His pathetic attempts at humour, insensitivity and grossly misleading comments were devoid of any facts and were highly offensive, embarrassing and cringe-worthy," he said.
"They need to be called out for what they are. His speech exemplifies what the LGBTI community have had to endure for so long."
For some MPs, it was personal
Liberal backbencher Kevin Andrews, who is against same-sex marriage, believes the bill contains very little protection for religion and belief.
The former cabinet minister told parliament that marriage was a "natural arrangement" between a man and a woman and pre-dated politics.
"To claim that there will not be a range of adverse consequences for the freedom of speech, religion and parental rights ... is wrong," Mr Andrews said.
"A significant concern that millions of Australians have about these proposed changes to marriage laws is the manner in which the freedom of speech and religion is threatened."
Liberal colleague Sarah Henderson, however, backed the change.
In an emotional speech, she recalled the struggles one of her closest friends - John Parker, a gay man - before his death earlier this year.
"He really wanted to see this change in the law," she said through tears.
"One of the last conversations I had with him, he just said to me: 'Hendo, just bloody well get on with it, OK?' I say to my dear beloved friend who I miss dearly: JP, that's what we are doing."