If you care at all about anti-semitism in the Labour party, or Islamophobia in the Conservative party, you’ll likely have been horrified by the hypocrisy on display at PMQs today. If politics is about living up to the historical moment, David Cameron failed utterly, showing himself to be more interested in Tory election results than the toxic politics which overtook British politics last week.

The Tory leader saw an opening and he took it. He knew that Jeremy Corbyn had plenty of weak spots on the issue of anti-semitism. Of all the Labour leader’s questionable comments over the years, he chose his statement that Hamas and Hezbollah were "friends". Corbyn says this was meant in a "collective" way as part of a meeting in parliament to further the peace process.

Taken alone, that’s reasonable. It is hard to imagine any way forward in the Middle East without these organisations having some sort of role. But Corbyn’s comments are part of a web of statements which raise questions about his commitment to fighting anti-Semitism and specifically to rooting out anti-semitism in the Stop the War elements of his party, which disproportionately support his leadership.

Regardless of any of that, Cameron had his bone and wouldn’t let go. He actually succeeded in turning the question structure of PMQs on its head and being the one who scrutinised the leader of the opposition. Corbyn needed to make clear he did not support Hamas, he said, "and he needs to do it today".

Corbyn - shockingly weak today, even by his own standards - said there was no place for anti-Semitism in our society and that we all "have a duty to oppose it". He made clear that he’d set up an inquiry headed by former Liberty director Shami Chakrabarti. "The points he was making earlier relate to a discussion I was having for the peace process," he added. "I absolutely do not approve of those organisations."

But it didn’t matter what he said, Cameron wouldn’t let go. "Hamas and Hezbollah believe in killing Jews," Cameron said. "Withdraw that they’re your friends." Question after question saw Cameron twist the structure of PMQs and demand Corbyn go further in disowning Hamas, although he had already done so.

Gradually it became clear. This wasn’t about clearing up Labour of anti-Semitism. It was about making Labour bleed.

With polling stations opening in less than 24 hours, the prime minister wanted the words 'Hamas' and 'Labour' to share as many sentences as possible. Finally, Corbyn managed to switch the spotlight around and ask questions about the Tories’ own campaign for City Hall, which has seen Zac Goldsmith regularly raise unfounded connections between Sadiq Khan and Islamic extremists. The clear message of the Tory campaign is: You can’t trust a Muslim to be mayor. Even a Muslim as utterly and unquestionably moderate as Khan.

"I’d invite him to think carefully about his party in the London elections," Corbyn said. "The way they are systematically smearing my friend, the member for Tooting [Khan]."

Of course, Cameron was not going to disavow the Tory mayoral election campaign just before polls open. But instead of sidestepping it, he doubled down. "There is a pattern of behaviour with the honourable member for Tooting," he said. And suddenly we were back where we were two weeks ago, with Cameron making comments about the people Khan has "shared a platform with".

Last time, it all unravelled instantly. Suliman Gani, the man Khan had shared a platform with, was in fact a Tory supporter. He had turned against Khan over - of all things - gay marriage. Oh and he’d "shared a platform" with Conservatives before too. Cameron’s claim that he supported Islamic State appeared to be completely false. Certainly Downing Street could not substantiate it and Cameron declined to repeat the allegation outside of the palace of Westminster, where he is protected from a legal challenge by parliamentary privilege.

Today, that last allegation was tweaked slightly. "He stood on a platform with people who wanted an Islamic state," Cameron said. So he didn’t support IS and was instead being accused of - there it is again - "sharing a platform" with people who believe in Islamic states in general. Downing Street is still cynically manipulating the vague distinction between the group Islamic state and the notion of an Islamic state. The vagueness of that distinction is exactly what the terror group likes to capitalise on. It is disappointing that, after demonstrating such righteous indignation over the BBC’s use of the name Islamic State, that is a vagueness Cameron is also prepared to use to his advantage.

But his cynicism is so much worse than that. The Tory London message is that any Muslim, no matter how loyal to Britain, no matter how moderate, no matter how civil in their discourse or secular in their convictions, will be dubbed an extremist if they try to engage with mainstream Westminster politics. The Tory campaign is a locked door, held fast against Muslims in British political life. It directly validates the rhetoric of the extremists because it says: There is no acceptance of you in the mainstream. The Tories are the ones playing into the extremists hands.

And by making his concerns about Labour anti-Semitism so obviously party political, Cameron will have discouraged those in the oppositon from actually doing something about it.

The prime minister is completely uninterested in the reality of racism in Britain, or in the Tory party, or Labour. These are just cheap, short-term political games, intended for Friday morning election results rather than the long-term interests of the country, He doesn’t care what he breaks along the way.

Corbyn has been slow to the point of complicity in addressing anti-Semitism in the Labour party. Cameron has allowed the Tory campaign for City Hall to become utterly Islamophobic and a recruitment aid to extremists.

They were both pitiful today: cynical, irresponsible and painfully short-sighted. Of the two, Cameron was by far the worst culprit. But no-one watching today’s session could have emerged with much faith in the British political class to drag themselves out of this poisonous mess.

Ian Dunt is the editor of Politics.co.uk

The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners