Cameron and President Hassan Rouhani agreed after their meeting on Wednesday to seek to improve ties between their countries, and accepted that reaching a long-term nuclear deal with major powers was crucial.
"The PM and President acknowledged that there had been significant differences between their countries in the past, and agreed we should seek to progressively improve our bilateral relationship," Cameron's office said in a statement.
The two leaders also discussed the threat of "Islamic State" (IS) militants, who have taken control of large parts of northern Iraq and Syria.
The British prime minister later spoke to the UN General Assembly, saying that Iran "should also be given the chance to show it can be part of the solution, not part of the problem."
"Iran's leaders could help in defeating the threat from ISIL," Cameron said, referring to IS.
"They could help secure a more stable, inclusive Iraq, and a more stable, inclusive Syria. And if they are prepared to do this, then we should welcome their engagement."
Britain and Iran have recently taken steps to improve relations, which have been tense since the 1979 revolution that overthrew the Western-backed shah. London severed diplomatic ties with Iran after activists stormed its embassy in Tehran in late 2011.
In the wake the election of the more moderate Rouhani in last year, Britain said in June it would reopen its embassy in Iran in the coming months.
Cameron wants to join Iraq strikes
While addressing the General Assembly, Cameron said he would ask Parliament to approve joining the US and Arab partner nation airstrikes currently being carried out against IS in Iraq.
"We must not be so frozen with fear that we don't do anything at all," he said. "We have a need to act in our own national interest to protect our people and our society. So it is right that Britain should now move to a new phase of action."
Cameron said the Iraqi government had requested Britain's participation in the strikes. He met with Iraqi Prime Minister Haider al-Abadi at the UN earlier in the day.
There was no mention of also participating in the strikes underway in Syria.
Cameron warned against striking "a deal" with embattled Syrian President Bashar al-Assad in order to defeat IS, calling that line of thinking "dangerously misguided."
dr/crh (AFP, AP, Reuters, dpa)