Earlier, many supporters had gathered on the lawn outside parliament. They included prominent same-sex marriage advocates, including former Olympic swimmer Ian Thorpe and local comedian Magda Szubanski.

More than 100 MPs had spoken on the legislation after it was tabled in the House of Representatives.

Many senators and MPs related personal stories in explaining why they supported the bill. One MP's speech ended with a marriage proposal - a first for the lower house.

Media playback is unsupported on your device

Media captionWill you marry me? Australian politician proposes to his partner in parliament

However, other politicians expressed their opposition.

"It is a special relationship between man and a woman for the purposes, if you are so lucky, for bringing children into the world," Deputy Prime Minister Barnaby Joyce said on Thursday.

Couples who wed overseas, or have already done so, will automatically have their marriages recognised in Australia.

Did the debate cause controversy?

Yes. The national vote, a voluntary postal survey, followed two failed attempts by the government to hold a compulsory poll that was twice voted down by the Senate.

Senators who opposed the compulsory vote did not necessarily oppose legalisation, but said the vote would be costly and fuel hate campaigns. They argued the matter should be put to a parliamentary vote.

Many same-sex marriage advocates levelled the same criticism at the voluntary vote, which did not require legislative approval.

During the eight-week survey, both supporters and opponents of same-sex marriage were accused of bullying and conducting misleading campaigns.