The Labour candidate for London mayor Sadiq Khan, has rejected the prime minister's accusation that he has associated with extremists.
At prime minister's questions, David Cameron questioned Mr Khan's judgement over sharing a platform with a man he said supported so-called Islamic State.
A Labour spokesman said Mr Cameron's comments "demeaned the office of prime minister".
Mr Khan accused him of joining a "divisive, dog-whistling campaign".
Speaking about violent extremism, the prime minister said: "It's very important we do not back these people and we do not appear on platforms with these people."
He continued: "I am concerned about Labour's candidate for mayor of London, who has appeared again and again and again," before being interrupted by shouts of "shame" and "disgrace" from the Labour benches.
He went on to say Mr Khan had appeared on a platform nine times with a preacher from his Tooting constituency, Suliman Gani, whom Mr Cameron alleged "supports IS".
He added: "If you do it time after time after time it is right to question your judgement."
Mr Khan tweeted: "Disappointed PM has joined Zac Goldsmith's divisive, dog-whistling campaign. I've fought extremism all my life."
The Conservative candidate for mayor, Zac Goldsmith, has repeatedly accused the Labour MP for Tooting of "giving platforms and oxygen and even cover to people who are extremist".
Mr Khan maintains that he has fought strongly against radical Islamists and has himself been a victim of their threats.
In a BBC London debate on Monday, Mr Khan said he had "never hidden" the fact that, as a former chairman of Liberty and a human rights lawyer, he had acted for "some pretty unsavoury characters".
And when asked if he regretted sharing a platform with extremists, he said: "I regret giving the impression I subscribed to their views and I've been quite clear I find their views abhorrent."
Mr Goldsmith insists he has never labelled his Labour rival an "extremist" but says it is right to ask questions about his opponent's past.
Asked what evidence Mr Cameron had that Mr Gani was a supporter of IS, the prime minister's official spokeswoman said at a Westminster press briefing: "The point the prime minister was referring to was that at events, this individual has spoken up in support of a range of things including the formation of Islamic State."
Mr Gani responded on Twitter saying: "I hope the prime minister will reflect and retract his comments. This is defamation at its highest level."