Delegates at Labor's national conference in Sydney have voted to give MPs a conscience vote on the issue of gay marriage.
At the same time, the conference also voted to change its policy platform on the legal definition of marriage to extend it to same-sex couples.
That move had been fiercely opposed by some within the party, including powerbroker Joe de Bruyn, who argue the change would see Labor lose public support.
"Are we really going to say that something we regarded as fundamental all this time, we should now turn on its head?" he asked delegates.
The amendment to ensure MPs were allowed a conscience vote on the issue was moved by Prime Minister Julia Gillard, and was carried by 208 votes to 184.
"You all know what my views on this debate are and I know many in this hall do not agree with my views on this debate," she told delegates.
"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."
Labor veteran John Faulkner argued against Ms Gillard's motion.
"A conscience vote on human rights is not conscionable," he said.
He spoke in support of changing the party platform on same-sex marriage, saying it is time to discard "the limitations and bigotry" of the last century.
"They are not privileges to be extended to one person and denied to another according to the whims of popular opinion or the whims of the government of the day," he said.
"They are inherent in each and every one of us simply because we are human."
Federal Labor backbencher, Stephen Jones, will move a private members bill in Parliament next year to allow gay marriage.
ACT Deputy Chief Minister and Rainbow Labor member Andrew Barr told the conference gay couples deserve respect, equality and dignity.
"Support for this motion today represents another critical step towards the removal of discrimination that is intensely felt by Australians who've been living in long term, loving same-sex relationships and for those who aspire to those relationships," he said.
After the vote, Senator Penny Wong thanked Ms Gillard for allowing the issue to be debated, despite the Prime Minister's opposition to gay marriage.
"I've not had a Labor leader who has been willing to engage in the fullness of this debate… and for that I thank her," she said.
"As I said at the outset I think it says something about the measure of the woman that she's willing to allow this forum of the conference to do what it wanted to do, which is to have a full and frank debate."
Labor is now ramping up the pressure on the Opposition to follow the move and offer Coalition MPs a conscience vote.
"We made a very clear decision in our conference, the democratic forum of the Labor party, that we would support equality without exception," she said.
"The real politics of now getting the reform through are now in Tony Abbott's court."
Up to 5,000 people have marched to Sydney's Darling Harbour to rally outside the conference in support of gay marriage.
The crowd shouted chants such as "conscience vote, no way, we want equal rights today."
Anthony Wallace from Equal Love says it is good that Labor voted to adopt an equal marriage act, but says the party should have taken a stronger stance to ensure the issue is passed by parliament.
"Unfortunately, we really wanted Labor to pick it up and go, we're going to run with this, this is our belief, we've debated it and this is the party platform, it's a bit of back step now they've decided that they will push it, it's going to go through for a conscience vote, it's kind of like they gave us something and they've pulled half of it back," he said
Meanwhile, police have had to keep supporters of same-sex marriage away from a smaller rally, where about 400 people who want marriage to remain as a union between a man and a woman gathered.
A smaller group of same-sex marriage supporters tried to drown out the speeches with repetitive chants, but police kept them apart.
New South Wales Christian Democrats MP Fred Nile told the crowd marriage is sacred.
"Marriage wasn't planned by John Howard or by the government, marriage was ordained and planned by God creator," he said.
A group in support of gay marriage will march towards the ALP national conference in Darling Harbour this afternoon.''