Australia's Parliament has voted to allow same-sex marriage across the nation, sparking celebrations and declarations of "a day for love".
The House of Representatives passed a bill to change the definition of marriage to simply "a union of two people", instead of a man and a woman, after the country overwhelmingly endorsed the move in a public ballot last month following a bitter and divisive debate.
Prime Minister Malcolm Turnbull proclaimed a "day for love, for equality, for respect" as Australia became the 26th country in the world to legalise same-sex ceremonies.
The public gallery erupted with applause, cheers and singing after the bill passed on Thursday.
Votes were not counted because the majority was not questioned, but fewer than five MPs registered their opposition. The Senate passed the same legislation last week by 43 votes to 12.
The laws, which will also recognise same-sex marriages solemnised in foreign countries, will take effect from Saturday. Because a month's notice is required for the state to recognise a marriage, the first legal same-sex unions will be in January.
"What a day. What a day for love, for equality, for respect," said Mr Turnbull. "It is time for more marriages, more love, more respect... This belongs to us all. This is Australia."
Sixty-two per cent of Australians had endorsed legalising same-sex marriage in a government-commissioned postal survey run by the national statistics agency.
The bill cleared the upper house last month, and the Liberal-National coalition government and the main opposition Labor Party had said they wanted it to pass the House of Representatives by 7 December.
But religious organisations and conservative lawmakers voiced strong opposition and proposed dozens of amendments.
During parliamentary debate, they pressed for broad protections for religious objectors, among them florists and bankers, to refuse service to same-sex couples.
But the amendments were all defeated during three days of debate, although the issues may be considered at a later date. The government has appointed a panel to examine how to safeguard religious freedoms once gay marriage is a reality in Australia.
"These amendments, rather, are a shield for people and organisations that hold to a traditional view of marriage. They are not a sword to be wielded in the service of bigotry," government MP Andrew Hastie said in Parliament.
Lawmakers in support of marriage equality had argued that the national postal survey in November gave a mandate simply for redefining marriage, so changing the law should not be delayed by other considerations.
"It is now our job as members of Parliament to pass a fair bill that does not extend or create any new discriminations," an emotional Warren Entsch, a Liberal MP helped draft the bill, told Parliament. "It is a strong bill that already strikes the right balance between equality and freedom of religion."
Greens party senator Janet Rice, speaking before the vote, said: "It's an historic day for Australia today and I think the celebrations around the country when we finally... achieve marriage equality are going to be immense."
Ms Rice was only able to remain married to her transgender wife of 31 years, Penny Whetton, because Penny remained listed as male on her birth certificate.
Penny Wong, an opposition Labor Party senator who has two children with her lesbian partner, said: "I am feeling happy."
Most gay rights advocates believed the government should have allowed marriages years ago and saw various ideas for a public survey as a delaying tactic. The United Nations Human Rights Committee had called the postal ballot "an unnecessary and divisive public opinion poll."
The bill allows churches and religious organisations to boycott gay weddings without violating Australian anti-discrimination laws. Existing civil celebrants can also refuse to officiate at gay weddings, but those registered after gay marriage becomes law would not be exempt from the anti-discrimination laws.
One of the rejected amendments would have ensured Australians could speak freely about their traditional views of marriage without fear of legal action. It was proposed by Attorney-General George Brandis and supported by the Prime Minister, both gay marriage supporters.
Former Prime Minister Tony Abbott, a high-profile opponent of same-sex marriage, told Parliament that Mr Turnbull and opposition leader Bill Shorten had failed to deliver detailed protections for freedoms of speech, conscience and religion in the bill.
"A promise was made by the leaders of this Parliament and the promise has not adequately been delivered on," Mr Abbott said.
He pointed to an Australian teenager who lost her job for opposing against gay marriage on social media and an Australian Catholic bishop who was taken before a state anti-discrimination tribunal over a pamphlet he published extolling traditional marriage. The complaint against the bishop was dropped.
"The last thing we should want to do is to subject Australians to new forms of discrimination in place of old ones that are rightly gone," said Mr Abbott.
Several gay marriage opponents in Mr Turnbull's conservative coalition regarded marriage equality as inevitable and have welcomed an end to an issue that has long divided the government ranks.
Finance Minister Mathias Cormann, a same-sex marriage opponent who oversaw the postal ballot, said he felt "great satisfaction" the issue was resolved.
"It was a polarising issue on which good Australians had strongly and sincerely held views on both sides of the argument," Mr Cormann said. "Australian people embraced the process and the result was emphatic."