The federal government's proposed same-sex marriage plebiscite has been defeated in the Senate.
Legislation to enable a national vote was defeated 33 votes to 29, with Labor, Greens, the Nick Xenophon Team and independent Derryn Hinch opposing it.
Liberal backbencher Dean Smith was absent from the chamber, after earlier speaking out against the plebiscite.
“Tonight the plebiscite on marriage equality was defeated in the Senate, and tonight we moved forward towards equality,” Greens’ LGBTIQ spokesperson Senator Janet Rice said in a statement.
Earlier, Liberal backbencher Dean Smith slammed his government's proposed same-sex marriage plebiscite, warning it could open a floodgate that could see Australians voting to lock out immigrants.
The gay senator said his opposition to the plebiscite stemmed from his position as a constitutional and parliamentary conservative.
Several gay senators made impassioned pleas against the plebiscite, telling parliament it would denigrate their families and subject them to hate speech.
Senior Labor figure Penny Wong spoke of how she decided to oppose the plebiscite after much soul-searching, deciding it was not the right path to same-sex marriage.
"We do not want our families and our children publicly denigrated," she told parliament.
"This hate speech is not abstract, it is real, it is part of our daily life."
The secular state should not impose the theology of some on all Australians, she said.
"Speaking personally, I do not think the God of my faith would be affronted by who I am, my relationship, or my family.
"Australians overwhelmingly support marriage equality yet now Malcolm Turnbull is asking them to do as opponents of that equality demand, to take a path he did not support."
Greens senator Janet Rice, who married her transgender wife Penny 30 years ago when she was Peter, said Australia did not need to be put through a divisive debate that would not even be binding on parliamentarians.
To stay married, her wife is unable to update her birth certificate to reflect her changed gender.
"We know that our same-sex marriage is just as important and valid and deep and wonderful and loving as our heterosexual one was," she said.
"People's human rights should not be subject to a popular vote."
Special Minister of State Scott Ryan, who supports marriage equality, said arguments a plebiscite would subject gay couples to hurtful comments was foolish.
There may be a small number of individuals who behave inappropriately during the debate, but that's true for any contentious debate, he said.
"Anyone who thinks that stopping a plebiscite means stopping discourteous speech is fooling themselves," he told parliament.
Liberal Democrat David Leyonhjelm said gay marriage could remain a highly partisan issue for years to come if the plebiscite doesn't go ahead.
Anyone claiming the plebiscite should be scrapped because of the potential for hurtful comments needed to "harden up", he said.