Addressing the UN General Assembly in New York on Tuesday, Cameron said Iran could be "part of the solution" in the fight against IS jihadists, while making clear his criticisms of Tehran's "support for terrorism organisations".
"It is regrettable that a country which, by its actions and support, has aided terrorism and infected our part of the world with the evil of the Daesh (IS), can accuse Iran which has always been at the frontline in the fight against terrorism," said Iranian foreign ministry spokesman Marzieh Afkham.
But Iran, a Shiite clerical regime, is a staunch foe of IS, the Sunni Muslim jihadists against which a US-led coalition has been targeting with deadly air strikes.
It has accused Sunni Arab and Western nations of helping to create IS by backing the rebellion against Syrian President Bashar al-Assad.
In his UN address, Cameron said "Iran's leaders could help in defeating the threat from ISIL," using another acronym for the Islamic State group (IS), which has committed widespread atrocities after overrunning swathes of Iraq and Syria.