London now has its first ever Muslim mayor. Sadiq Khan, the Labour party candidate, received the largest ever number of votes of any London mayoral candidate and won with a margin of more than 10 percent.

The Conservative party, having run a campaign attempting to depict Khan as a security menace with links to Muslim "extremists", found that it was blowing "a dog whistle in a city where there's no dog".

In other circumstances, this election might have been rather dull. Both Khan and his opponent Goldsmith are centrist politicians, with differences chiefly of emphasis.

But with the pendulum swinging towards Labour, the Conservatives decided to road-test an approach, which they have been developing since Jeremy Corbyn won the Labour leadership, of attacking Labour on traditional Cold War grounds of national security, with the added Islamophobic inflections of the "war on terror" era.

Guilty by association

Thus, the Conservatives adopted a strategy of guilt-by-association, hyping Khan's alleged "extremist links". For example, in the House of Commons, Prime Minister David Cameron used parliamentary privilege - meaning he couldn't be sued for his remarks - to make libellous allegations against Suliman Gani, an imam who had appeared on a platform with Khan.

Cameron asserted that Gani supported the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group. When this was found to be false, the prime minister's office, almost with a perceptible shrug, claimed that Cameron had only meant to say that Gani supported "an Islamic state".

This did not prevent broadcasters from repeating the charge, nor Defence Secretary Michael Fallon from defending the claim after the election.

This campaign period shocked many Conservative figures. Peter Oborne, a Tory journalist, compared the campaign to an infamous 1964 general election in which the Conservatives had run on the slogan: "If you want a nigger for a neighbour, vote Labour".

OPINION: Londoners win as Sadiq Khan cruises to victory

Andrew Boff, the former leader of the Conservative group of the London Assembly, excoriated the party's "outrageous" campaign.

Baroness Sayeeda Warsi, a former cabinet member, declared that "the right needs to weed out its Islamophobes". Mohammed Amin, chairman of the Conservative Muslim Forum, took the opportunity following Khan's win to denounce the smears, claiming that Islamophobia would drive some "impressionable young British Muslims" into the arms of ISIL. Muslim leaders of the Conservative Party have congratulated Khan for his victory.

In-party strife

The smears were not for want of prophylaxis on Khan's part. No sooner had he been selected as Labour's mayoral candidate - as part of the same process that saw Corbyn elected as party leader - than he was denouncing Corbyn for "encouraging" terrorism and inciting anti-Semitism.

He also made sure to distance himself from his twice-elected Labour predecessor, Ken Livingstone. And he repudiated his past support for boycott campaigns aimed at Israel. But this only alienated Labour's grassroots and was not enough to placate Conservative opponents, nor Labour politicians who wanted to see him lose.

Khan's overwhelming victory is all the more remarkable for one other factor: the attempt on the part of some Labour Party big beasts to throw the election in order to damage Corbyn.

Khan's overwhelming victory is all the more remarkable for one other factor: the attempt on the part of some Labour Party big beasts to throw the election in order to damage Corbyn.

Shortly after Khan's nomination, the columnist Dan Hodges let it be known that anti-Corbyn Labour MPs were quietly briefing him that they wanted Khan to lose.

In some cases, the opposition was explicit. Lord Alan Sugar, a Labour peer, wrote a scathing article for The Times urging Londoners not to elect Khan because of his support for Ed Miliband, his nomination of Jeremy Corbyn, and his willingness to talk to the trade unions.

In the months before the election, former Deputy Prime Minister John Prescott denounced a clutch of bitter former advisers to Tony Blair for trying to sabotage Labour's chances behind the scenes.

OPINION: Beware of 'What British Muslims Really Think?'

Finally, in the weeks before the election, a number of Labour MPs used a handful of cases of alleged anti-Semitism in the party, linked to anti-Israel sentiment, to create a crisis for the leadership.

If they knew that they were playing into Conservative attempts to depict Khan as a pawn of "extremists" in doing so, they did not care.

Khan's victory - in part despite his own efforts - is a repudiation of this fearmongering. Had the Conservative strategy worked in London, it would have been rolled out across the United Kingdom.

The long backlash against "multiculturalism" has hit a solid wall in London. On social media, the racist carping about the capital becoming "Londonistan" - a sobriquet analogous to old anti-Semitic complaints about "Jew York" - is being rehashed by the Islamophobes.

But it is also being joyfully, ironically appropriated by those who are glad to see a racist campaign defeated. Welcome to the 21st century. Welcome to free Londonistan.

Richard Seymour is an author and broadcaster based in London. He has written for The Guardian, the London Review of Books and many other publications.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.