MELBOURNE, Australia — A solid majority of Australians voted in favor of same-sex marriage in a historic survey that, while not binding, paves the way for Parliament to legally recognize the unions of gay and lesbian couples.

MELBOURNE, Australia — A solid majority of Australians voted in favor of same-sex marriage in a historic survey that, while not binding, paves the way for Parliament to legally recognize the unions of gay and lesbian couples.

Of 12.7 million Australians who took part in the survey, 61.6 percent voted yes and 38.4 percent voted no, officials announced on Wednesday morning. Participation was high, with 79.5 percent of voting-age Australians taking part.

Of 12.7 million Australians who took part in the government survey, 61.6 percent voted yes and 38.4 percent voted no, officials announced on Wednesday morning. Participation was high, with 79.5 percent of voting-age Australians sending back their postal ballots.

“The Australian people have spoken, and they have voted overwhelmingly ‘yes’ for marriage equality,” said Prime Minister Malcolm Turnbull, who had called the national survey as a way to put pressure on conservative lawmakers, many from his own party. “They voted ‘yes’ for fairness, they voted ‘yes’ for commitment, they voted ‘yes’ for love.”

“The Australian people have spoken, and they have voted overwhelmingly ‘yes’ for marriage equality,” said Prime Minister Malcolm Turnbull, who called the survey in a move described by advocates as a delay tactic devised to appease his party’s far-right faction. “They voted ‘yes’ for fairness, they voted ‘yes’ for commitment, they voted ‘yes’ for love.”

The results were announced as proponents of gay rights gathered at public events in cities around the country to watch the news. The largest crowd, at Prince Alfred Park in Sydney, broke into cheers as the news became clear.

The high turnout and unequivocal result amounted to a rebuke for Australia’s most conservative politicians, many of whom saw a majority of their constituents vote to support same-sex marriage despite their arguments against it.

Proponents of gay rights spent the day celebrating. They gathered at events in cities around the country to watch news broadcasts of the survey results. The largest crowd, at Prince Alfred Park in Sydney, broke into cheers, with hugs, dancing and tears, as soon as they heard the news.

“This is our proudest moment as gay and lesbian Australians,” said Chris Lewis, 60, an artist from Sydney, who waved a large rainbow flag he bought in San Francisco about 30 years ago. “Finally I can be proud of my country.”

“This is our proudest moment as gay and lesbian Australians,” said Chris Lewis, 60, an artist from Sydney, who waved a large rainbow flag he bought in San Francisco about 30 years ago. “Finally I can be proud of my country.”

Annika Lowry, 42, who brought her 4-year-old daughter to the celebration, said the vote “was not just about us — it’s for our kids, so that they know equality is important.”

But many Australians said it was also late in coming.

Annika Lowry, 42, who brought her 4-year-old daughter to the celebration, said the vote revealed a widening gap between Australia’s political class and voters who have been demanding same-sex marriage legislation for years.

“It was not just about us,” she said. “It’s for our kids, so that they know equality is important.”

Alex Greenwich, a state lawmaker from New South Wales and the co-chairman of Australian Marriage Equality, an advocacy group, said the vote “shows that Australians have truly come together in support of their gay and lesbian mates and have said that everybody should be able to have the freedom to marry.”

Alex Greenwich, a state lawmaker from New South Wales and the co-chairman of Australian Marriage Equality, an advocacy group, said the vote “shows that Australians have truly come together in support of their gay and lesbian mates and have said that everybody should be able to have the freedom to marry.”

In calling for the national survey, Mr. Turnbull sought public backing for a shift in social policy that was opposed by many members of his center-right Liberal Party.

In calling for the national survey, Mr. Turnbull sought public backing for a shift in social policy that was opposed by many members of his center-right Liberal Party.

Mr. Turnbull voted yes, and urged other Australians to do so as a matter of fairness, seeking to blunt opposition from far-right members of his party.

Mr. Turnbull voted yes, and urged other Australians to do so as a matter of fairness, seeking to blunt opposition from far-right members of his party.

“My commitment was to give every Australian their say,” Mr. Turnbull said after the results were announced. “That has been done, they have spoken.”

“My commitment was to give every Australian their say,” Mr. Turnbull said after the results were announced. “That has been done, they have spoken.”

He added: “Now it is up to us, here in the Parliament of Australia, to get on with it — to get on with the job the Australian people have tasked us to do, and get this done, this year, before Christmas.”

He added: “Now it is up to us, here in the Parliament of Australia, to get on with it — to get on with the job the Australian people have tasked us to do, and get this done, this year, before Christmas.”

Dean Smith, a federal senator from the right-leaning Liberal Party, who is gay, said that he would immediately introduce a bill to legalize same-sex marriage. He said on Tuesday that he believed he had the votes to pass the legislation in the Senate and send it to Parliament’s lower house for approval.

Dean Smith, a federal senator from the right-leaning Liberal Party, who is gay, said that he would immediately introduce a bill to legalize same-sex marriage. He said on Tuesday that he believed he had the votes to pass the legislation in the Senate and send it to Parliament’s lower house for approval.

Lyle Shelton, a Christian lobbyist who was the “no” campaign’s most outspoken advocate, said he would begrudgingly “accept the democratic decision.”

Lyle Shelton, a Christian lobbyist who was the “no” campaign’s most outspoken advocate, said he would begrudgingly “accept the democratic decision.”

“Millions of Australians will always believe the truth about marriage, that it’s between one man and one woman,” Mr. Shelton said. “It could take years, if not decades, to win that back.”

“Millions of Australians will always believe the truth about marriage, that it’s between one man and one woman,” Mr. Shelton said. “It could take years, if not decades, to win that back.”

The record of subjecting same-sex marriage to a public vote remains mixed.

The record of subjecting same-sex marriage to a public vote remains mixed.

In 2015, Ireland was the first country to legalize same-sex marriage by referendum, but the same year, voters in Slovenia rejected a law legalizing such unions.

In 2015, Ireland was the first country to legalize same-sex marriage by referendum, but the same year, voters in Slovenia rejected a law legalizing such unions.

In the United States, numerous states outlawed same-sex marriage in referendums; in 2012, Maine, Maryland and Washington became the first states to legalize such unions by referendum. The United States Supreme Court legalized same-sex marriage across the nation in 2015.

In the United States, numerous states outlawed same-sex marriage in referendums; in 2012, Maine, Maryland and Washington became the first states to legalize such unions by referendum. The United States Supreme Court legalized same-sex marriage across the nation in 2015.

The survey in Australia was controversial, not only because it placed such a thorny issue at the whims of direct democracy but also because of its cost.

The survey in Australia was controversial, not only because it placed such a thorny issue at the whims of direct democracy but also because of its cost.

As the deadline approached for citizens to mail in their ballots, passions were inflamed by heartfelt pleas and vitriolic attacks.

As the deadline approached for citizens to mail in their ballots, passions were inflamed by heartfelt pleas and vitriolic attacks.

Many advocates for same-sex marriage opposed the survey, saying that human rights should not be a matter for an up-or-down vote and urging Parliament to decide the matter.

Many supporters of same-sex marriage opposed the survey, saying that human rights should not be a matter for an up-or-down vote and urging Parliament to decide the matter.

Estimates put the cost of the survey around 122 million Australian dollars, or $97 million. The poll was not a legally required step for changing the law.

Estimates put the cost of the survey around 122 million Australian dollars, or $97 million. The poll was not a legally required step for changing the law.

Activists in September challenged the survey’s legality, arguing that it was an unconstitutional use of tax money, but Australia’s High Court allowed the poll to proceed. In the end, the response rate was higher than supporters of same-sex marriage anticipated, showing the extent to which mainstream opinion has shifted in support of sexual minorities.

Activists in September challenged the survey’s legality, arguing that it was an unconstitutional use of tax money, but Australia’s High Court allowed the poll to proceed. In the end, the response rate was higher than supporters of same-sex marriage anticipated, showing both frustration with parliamentary inaction and the extent to which mainstream opinion has shifted in support of sexual minorities.

Although legalization is not guaranteed, the results announced on Wednesday make the country’s path to same-sex marriage much clearer.

Although legalization is not guaranteed, the results announced on Wednesday make the country’s path to same-sex marriage much clearer.

Mr. Greenwich said the outcome delivered “an unequivocal mandate for Parliament to legislate for this bill as soon as possible for a fair bill this year.”

Mr. Greenwich said the outcome delivered “an unequivocal mandate for Parliament to legislate for this bill as soon as possible for a fair bill this year.”

Focus has already shifted to that bill, and what form it will take.

Focus has already shifted to that bill, and what form it will take.

“After a cost of 122 million, and over two months of campaigning and years of public discussion, it makes no sense to delay a parliamentary debate,” Mr. Smith, the Liberal senator, said in an interview. “Australians upheld their end of the bargain by voting en masse. Now it’s time for Parliament to uphold its end of the same deal.”

“After a cost of 122 million, and over two months of campaigning and years of public discussion, it makes no sense to delay a parliamentary debate,” Mr. Smith, the Liberal senator, said in an interview. “Australians upheld their end of the bargain by voting en masse. Now it’s time for Parliament to uphold its end of the same deal.”

Mr. Smith’s bill provides for some religious protections and allows members of the clergy to refuse to solemnize marriages that conflict with their religious beliefs.

Mr. Smith’s bill provides for some religious protections and allows members of the clergy to refuse to solemnize marriages that conflict with their religious beliefs.

“That bill is obviously manifestly inadequate,” said Mr. Shelton, the opponent of same-sex marriage, who added that it focused on wedding ceremonies. “The ‘yes’ side should make good on its promise that no one else’s freedoms would be affected. They’ve maintained this all along. They’ve said that our concerns about freedom of speech and freedom of religion are red herrings.”

“That bill is obviously manifestly inadequate,” said Mr. Shelton, the opponent of same-sex marriage, who added that it focused on wedding ceremonies. “The ‘yes’ side should make good on its promise that no one else’s freedoms would be affected. They’ve maintained this all along. They’ve said that our concerns about freedom of speech and freedom of religion are red herrings.”

Mr. Shelton said Mr. Smith’s bill would affect Muslim and Christian schools who wish to teach that marriage is between one man and one woman. “We’re worried about bakers and florists being taken to court, as has occurred in the United States,” he added.

Mr. Shelton said Mr. Smith’s bill would affect Muslim and Christian schools who wish to teach that marriage is between one man and one woman. “We’re worried about bakers and florists being taken to court, as has occurred in the United States,” he added.

An alternative bill, proposed by another Liberal Party senator, James Paterson, has more robust religious protections. His bill would allow service providers like bakers and photographers to refuse service to same-sex couples, without facing legal action. His bill would provide additional anti-discrimination protections for religious people and businesses opposed to gay marriage. Reflecting the national debate that often centered on the well-being of children, Mr. Paterson’s bill would allow parents the right to take their children out of classes that “conflict with their values.”

An alternative bill, proposed by another Liberal Party senator, James Paterson, has more robust religious protections. His bill would allow service providers like bakers and photographers to refuse service to same-sex couples, without facing legal action. His bill would provide additional anti-discrimination protections for religious people and businesses opposed to gay marriage. Reflecting the national debate that often centered on the well-being of children, Mr. Paterson’s bill would allow parents the right to take their children out of classes that “conflict with their values.”

Mr. Turnbull said he did not believe Mr. Paterson’s bill could pass Parliament. “I don’t believe Australians would welcome, and certainly the government would not countenance, making legal discrimination that is illegal, that is unlawful, today.”

Mr. Turnbull said he did not believe Mr. Paterson’s bill could pass Parliament. “I don’t believe Australians would welcome, and certainly the government would not countenance, making legal discrimination that is illegal, that is unlawful, today.”

At least seven members of Australia’s Parliament have publicly committed to voting against any bill to legalize same-sex marriage, according to a report from the Australian Broadcasting Corporation. Most lawmakers, however, said they would support such a bill.

At least seven members of Australia’s Parliament have publicly committed to voting against any bill to legalize same-sex marriage, according to a report from the Australian Broadcasting Corporation. Most lawmakers, however, said they would support such a bill.

“There’s no denying that this has been tough for many people. This has been a campaign which has gone on for more than 10 years,” said Mr. Greenwich, the same-sex marriage advocate. “This result is a reflection of the leadership that’s been shown by everyday Australians during this campaign. It shows that Australians truly did have the opportunity to shape our nation as a fairer and more equal place.”

“There’s no denying that this has been tough for many people. This has been a campaign which has gone on for more than 10 years,” said Mr. Greenwich, the same-sex marriage advocate. “This result is a reflection of the leadership that’s been shown by everyday Australians during this campaign. It shows that Australians truly did have the opportunity to shape our nation as a fairer and more equal place.”