Boris Johnson spoke with Iran's president and called for an "end to hostilities" in the Gulf, Downing Street said.
The prime minister had a 20-minute discussion with Hassan Rouhani by telephone on Thursday morning, number 10 said.
A spokesman said the pair "discussed the situation in the region" following the death of Iranian general Qassem Soleimani in the United States.
PM: Iranian General had & # 39; blood of British troops on his hands & # 39;
They added that Johnson "emphasized the continued commitment of the United Kingdom" to the nuclear agreement signed between the West and Iran – despite US President Donald Trump urging the United Kingdom to follow his lead and abandon the agreement.
The prime minister also called for "continued detention of ill-treatment of Nazanin Zaghari-Ratcliffe and other dual citizens" – calling for their immediate release.
Major General Soleimani's murder last week increased tensions between Washington and Tehran.
Iran has responded to the US air raid near the Iraqi capital Baghdad by launching missile attacks on bases housing US and coalition troops.
Johnson supported Trump's aim at the Iranian general, telling Commons on Wednesday that Major General Soleimani had "the blood of British troops on his hands."
Trump said following Iran's response that Tehran appeared to be "standing".
But an Iranian commander, quoted by the Tasnim news agency, said he would soon take revenge "for the death of Major General Soleimani."
Qassem Soleimani was the architect of Iran's military and intelligence operations abroad.
Foreign Secretary Dominic Raab spoke with US Secretary of State Mike Pompeo on Wednesday.
He said the UK "recognizes the US right of self-defense and the serious threat that Iran poses in the region."
Raab added, "We need to ease tensions and discuss the need to find a diplomatic way forward."