One candidate ranted about the danger of the “homosexual lifestyle”.

Another called for the genital mutilation of non-Muslim women who support Islam.

A third made light of rape, and yet another boasted that he had “done more Asian than I know what to do with”.

Nearly every day in the brief run-up to the Australian election on 18 May, voters have confronted a new revelation of toxic speech by politicians, propagated largely on social media.

The offensive remarks have forced at least six candidates for parliament to quit, while many more linger like zombies — most of them from the conservative governing coalition and other parties on the right.

Tens of thousands protest against Australia Day Show all 8 1 /8 Tens of thousands protest against Australia Day Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Invasion Day protesters march down a street during Australia Day in Brisbane, Australia. EPA Tens of thousands protest against Australia Day Protesters shouts slogans as they march through the streets of Sydney in an "Invasion Day" rally on Australia Day. AFP/Getty Images

This Great Flushing Out, experts say, reveals a paradox.

Homophobia, Islamophobia and other markers of intolerance are more embedded in the country’s psyche and politics than many Australians want to admit.

But at the same time, analysts see signs of hope as the major political parties cast out candidates for their comments, drawing clearer lines than ever on what constitutes acceptable conduct.

“I’m amazed that these people are being asked to resign, because a lot of this stuff would have been seen as normal a few years ago,” said Susan Harris-Rimmer, a law professor at Griffith University in Queensland.

“I see it as a bit of a sign of success that they’re being forced to leave.”

The purge has not been confined to conservative parties.

The candidate who engaged in rape jokes on Facebook, and has since quit, was a young hopeful in Melbourne from the centre-left Labour Party.

But with less than two weeks to go in the campaign, it is clear that most of the troubling rhetoric has come from the political right.

The politician who called for genital mutilation, and has also quit, belonged to the conservative Liberal Party of Prime Minister Scott Morrison.

Another Liberal candidate resigned after it was revealed that he had encouraged conservative Christians to “infiltrate” the party to keep gay people from power.

He also talked about removing “termites” from the Liberal Party and bringing in the “Godly god”.

Experts say the 2019 race shows just how much casual mingling, fuelled by the internet, there is between conservative parties in Australia and the global far-right movement that has helped propel candidates to top offices from the United States to Eastern Europe and beyond.

How Australia handles this fact could be a turning point for its politics.

Social media has shaped the campaign more deeply than ever before, and this is the first Australian election to be held in the wake of a worldwide populist surge, testing whether the country would embrace or reject extremism in politics.

In some cases, the anti-Muslim comments from candidates appeared in online groups or threads populated by white supremacists.

Australian PM Scott Morrison says 'Hello' in Chinese to voter who replies 'No I'm Korean'

In others, discussions about women, homosexuality and transgender Australians have spiralled quickly from chauvinism to support for bullying or outright exclusion from politics.

“For most of the conservative parties, it’s become quite clear that the new generation of people moving into the parties are very much more right-wing than the generation that’s just disappeared,” said Andrew Jakubowicz, a sociology professor at the University of Technology, Sydney, who has studied online racism in Australia.

“There is almost nobody left who you would consider a small ‘l’ liberal; they’re all from the centre-right all the way to the right.”

The dynamics of social media, he added, have accelerated the shift by encouraging extreme speech and a sense of ideological camaraderie that can be manipulated by extremists.

“One of the things social media does is set up disinhibition,” Mr Jakubowicz said.

At the same time, he added, “there are quite significant groups of people in the white power, alt-right side of things who are trying to invade and normalise their views.”

These groups have already had some success.

Their perspective on immigrants is frequently found in the Murdoch-run news media, and in October, the Australian Senate voted to support a motion declaring that “it’s OK to be white” — a slogan rooted in American neo-Nazi ideas, spread by racists on websites like 4chan.

Only after academics pointed out that context did the government blame an “administrative error”, holding another vote and rejecting the motion.

Levi West, director of terrorism studies at Charles Sturt University in Canberra, said right-wing extremism had been rising in Australia over the last four or five years, tracking with the alt-right movement in the United States.

He noted that the right-wing online community was particularly large and savvy.

“They undertake quite a conscious exercise to clean up their image,” Levi said.

Support free-thinking journalism and attend Independent events

“You infiltrate yourself into the political apparatus and shape policy within the apparatus. It’s a much more insidious and effective way of achieving tangible political and policy outcomes.”

A recent example: one of Australia’s far-right leaders, Neil Erikson, attended a “conservative recruitment event” for the Liberal National Party (formed by the merger of the Liberal and National Parties in Queensland) at a private residence last year.

Still, despite the steady drumbeat of troubling rhetoric, it is far from clear that any of this will matter when the votes are counted.

The two major parties are engaged mainly in a war over taxes and the economy.

Many politicians are focusing less on the substance of the divisive comments than on the general decline in civility.

And some political analysts cite systemic issues, noting that many candidates are selected quickly, with minimal vetting, especially in long-shot seats, and that the concentrated election season can deliver damaging revelations in a burst.

But what seems clear, at least for now, is that the lines of demarcation in Australian politics remain closer to the centre than the extremes.

“Australia has been travelling down the same politically negative road as the US and UK have of late, but this is one of a number of signs that we are significantly less far down that track than they are,” said Chris Wallace, a historian at the Australian National University.

“Depending on the election result, we may be poised to reverse that trend here. Let’s hope so.”