Australia’s ruling Labor party has voted to support the introduction of gay marriage although party leader and prime minister Julia Gillard is opposed to changing the law.

“Never doubt how persistent the campaign for equality is,” said Finance Minister Penny Wong, who is in a long term same sex relationship.

So strong was the support for gay marriage at the conference that the motion was carried by strength of voices only.

Ms Gillard’s proposal to allow MPs to vote on any gay marriage legislation coming before parliament on a free, conscience vote was passed 208 to 184.

This means that legislation to introduce gay marriage looks almost certain to fail as Labor currently operates a minority government with support from three independent and one green MP. Ms Gillard and other members of the Labor party will vote against gay marriage as will the much of the opposition Liberal party which is opposed to recognising gay relationships.

More than 140,000 Australians have signed a petition supporting gay marriage that was presented to Mrs Gillard before the conference.

The petition said: “Prime Minister Gillard, delegates to the ALP [Australian Labor Party] National Conference: Not allowing same-sex couples to marry denies them and their families legal equality and perpetuates discrimination and prejudice.

“The overwhelming majority of Australians support full marriage equality and it is the right thing to do. Marriage matters: amend the Commonwealth Marriage Act so that same-sex partners can be wed.”

Andrew Barr, the Deputy Chief Minister for the Australian Capital Territory said a private members bill would go before the federal parliament at some point next year. “Gay, lesbian, bisexual, transgender and intersex Australians are part of our community,” he said.”We’re not nameless, faceless people who live on the margins of society. We deserve the respect and the dignity afforded to others. We deserve equality.”

Ms Gillard told the conference: “You all know what my views on this debate are and I know many in this hall do not agree with my views. But what is the most important thing is that as we have this debate in this hall, we have this debate in a climate and atmosphere of respect.”

Last week, a pro-marriage equality video produced by GetUp became an internet hit. It has been watched more than 3 million times in the last week.

Cohabiting same sex couples are recognised as defacto couples in all Australian states and territories. The states of New South Wales, Tasmania and Victoria offer gay couples civil unions. Civil partnerships are performed in the Australian Capital Territory.