Australia’s parliament has voted to allow same-sex marriage across the nation.

The decision follows a bitter debate settled by a much-criticised government survey of voters that strongly endorsed change. The public gallery in the House of Representatives erupted with applause when the bill passed.

It changes the definition of marriage from solely between a man and a woman to “a union of two people” excluding all others. The legislation passed with a majority that was not challenged, although five politicians registered their opposition.

(PA Graphics)(PA Graphics)

The Senate passed the same legislation last week 43 votes to 12. After royal assent and other formalities, the law is likely to take effect in about a month, with the first weddings expected about a month later.

Champagne and tears flowed in the halls of Parliament House as gay celebrities including Olympic champion swimmer Ian Thorpe and actress Magda Szubanski hugged politicians and ordinary people in a party atmosphere.

“What an amazing day, I’m a little bit delirious, it’s extraordinary,” said Ms Szubanski, who sat in the public gallery during Thursday’s debate.

Ian Thorpe was at Parliament House to celebrate a vote allowing same-sex marriage (Rod McGuirk/AP)Ian Thorpe was at Parliament House to celebrate a vote allowing same-sex marriage (Rod McGuirk/AP)

Thorpe thanked “our straight brothers and sisters” for strongly backing marriage equality in the two-month postal survey.

“Quite literally without them voting for us, this would never have happened,” Thorpe said. “It means that we’ve created an Australia that is more equitable, it’s more fair, it’s more just.”

Amendments meant to safeguard freedoms of speech and religion for gay-marriage opponents were all rejected, though those issues may be considered later.

The government has appointed a panel to examine how to safeguard religious freedoms once gay marriage is a reality in Australia.

Politicians advocating marriage equality had argued that the national postal survey in November mandated a change of the marriage definition alone, so changing the law should not be delayed by other considerations. Gay marriage was endorsed by 62% of voters who responded to the postal ballot.

“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 government lawmaker Warren Entsch, who helped draft the bill, said.

“It is a strong bill that already strikes the right balance between equality and freedom of religion.”

“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,” Janet Rice said before the vote.

Ms Rice is a minor Greens party senator who was only able to remain married to her transgender wife of 31 years, Penny, because Penny remained listed as male on her birth certificate.

Penny Wong, an opposition Labour Party senator who has two children with her lesbian partner, said: “I am feeling happy.”

Australian actress Magda Szubanski celebrates at Parliament House (AP Photo/Rod McGuirk)Australian actress Magda Szubanski celebrates at Parliament House (AP Photo/Rod McGuirk)

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 UN Human Rights Committee had called the ballot survey “an unnecessary and divisive public opinion poll”.

The current 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 celebrants registered after gay marriage becomes law would not be exempt from anti-discrimination laws.