Phil Woolas's wafer-thin victory in Oldham East and Saddleworth seat – he won by 103 votes following two recounts – was one of the more surprising results of the 2010 election. The former immigration minister had been defending a vulnerable 3,590 majority and had recently appeared to be humiliated on national television by Joanna Lumley over his handling of the row over UK residency for Gurkha veterans. He had already alienated much of the sizeable local Muslim community through a series of patronising comments including dismissing as "a load of crap" a young Muslim woman's concern that the UK's foreign policy in the Middle East was contributing to the radicalisation problem. Add to this the national outrage over MPs' expenses during which it was reported that Woolas had been submitting expenses for tampons and women's clothing and his chances of holding on to his seat did not look too promising. So how did he manage it?

Today's ruling by two high court judges in a specially convened election court found that Woolas smeared the Liberal Democrat opponent, Elwyn Watkins, as someone who pandered to Muslim extremists. In the words of the judgment, Woolas "made or published several false statements of fact in relation to the petitioner's personal character or conduct which he had no reasonable grounds for believing to be true and did not believe to be true."

During the court hearings it had emerged that Woolas's election agent, Joseph Fitzpatrick, had become convinced that the Lib Dems had built up sufficient momentum locally to defeat Woolas, or in Fitzpatrick's own words: "We are picking up the vibe that Phil is going to lose." On 25 April, less than two weeks before the general election, Fitzpatrick emailed Woolas's campaign adviser, Stephen Green, saying: "Tory voters are talking of voting Lib Dem ... If we can convince them that they are being used by the Moslems [sic] it may save [Woolas] and the more we can damage Elwyn the easier it will be to stop the Tories from voting for him". Fitzpatrick also wrote: "We need to go strong on the militant Moslem angle" and "We need … to explain to the white community how the Asians will take him out … If we don't get the white vote angry he's gone."

And so followed two new Labour pamphlets with the headlines "Lib Dem pact with the devil" and "Targeted: militant extremists go for Phil Woolas". Woolas's election literature also now claimed that he had received death threats "in extremist Muslim election leaflets". However in his testimony to the election court, Woolas noticeably failed to produce any evidence of the alleged death threat.

But perhaps their most provocative piece of electioneering was an A6 election card with a photo of Muslim extremists holding up a placard reading: "Behead those who insult Islam". The election card read: "Extremists are trying to hijack this election. They want you to vote Lib Dem to punish Phil for being strong on immigration … Will you stand by Phil?"

The extremists pictured were from a tiny demonstration held in London some four years previously – they had nothing to do with Oldham. Furthermore, the idea that they would want people to vote for the Lib Dems was just nonsense: the extremists regard voting for any of our mainstream political parties as being haram (forbidden). In truth, the card is unlikely to have looked out of place among the far-right BNP's election material, but it says much about how anti-Muslim bigotry has become more acceptable in the UK that this appeared under the banner of the Labour party. The Woolas team's campaign strategy appears to be dishonest and – in a town which had in 2001 experienced serious race riots – breathtakingly irresponsible. Just what madness had engulfed the local Labour party that they allowed this to happen?

Worryingly, Woolas himself appears to be totally unrepentant. He responded to the court verdict today saying:

"It is vital to our democracy that those who make statements about the political character and conduct of election candidates are not deterred from speaking freely for fear that they may be found in breach of election laws."

You can perhaps understand his reasoning. What on earth could he say? "Guilty of repeatedly lying about my opponent and making up inflammatory smears designed to pit communities against each other? But, your lordship, I am a politician."