Foreign Secretary Dominic Raab has urged Iran to "take a diplomatic route" to reduce tensions following the US killing of Iran's top military leader.
Mr Raab said the UK understood why the US killed Qasem Soleimani in a drone strike in Iraq last week, and the US "had a right to exercise self-defence".
But he told the BBC the UK now wanted to "de-escalate tensions" and avoid "a major war".
Iraqi MPs have since called for foreign troops to leave the country.
And the US-led coalition against the Islamic State group said it will not be training local allies.
Instead, it said it would focus for now on protecting Iraqi bases that host US, UK and other coalition troops.
A UK government spokesman said it was urging the Iraqi government to ensure the coalition would be able to continue its "vital work" against a "shared threat".
"The coalition is in Iraq to help protect Iraqis and others from the threat from Daesh (Islamic State), at the request of the Iraqi government," the spokesman said.
Prime Minister Boris Johnson is due to return to the UK later and will talk to foreign leaders in the coming days.
Soleimani, who had been head of the elite Iranian Quds Force, died in the drone strike in Baghdad on Friday.
Tehran has vowed to avenge the general's killing. The US has pledged to send 3,000 extra troops to the region while the UK has 400 troops in the Middle East.
Speaking to the BBC's Andrew Marr programme on Sunday, Mr Raab rejected the idea the killing was an act of war, adding: "Iran has for a long period been engaged in menacing, de-stabilising activities."
Pressed on whether the killing was legal, Mr Raab said: "My view is - and the operational assessment has been done by the Americans - is that there is a right of self-defence.
"It was General Soleimani's job description to engage proxies, militias across not just Iraq but the whole region, not just to destabilize those countries but to attack Western countries... In those circumstances the right of self-defence clearly applies."
'Bleak possibility of unending violence'
By BBC diplomatic correspondent James Robbins
Under enormous pressure from the Trump Administration, Britain has edged very slightly closer to the Americans over the killing of Soleimani, but has still stopped well short of the sort of full-throated support Washington has demanded from its allies.
In the absence of Boris Johnson on holiday in the Caribbean, it's been the foreign secretary who has articulated Britain's response.
Dominic Raab is now stressing a little more the threat posed by Soleimani in life, without retreating from British warnings of the possible consequences of his death.
So when Mr Raab told the BBC: "We understand the action they took but we need to be clearly focused on what happens next," it's important to note that "understanding" falls a long way short of endorsement or support. And in that single sentence, Mr Raab is determined to keep the focus on fears for the future.
The foreign secretary made little effort to conceal widely-held British fears that Washington has no coherent step-by-step strategy to help get Iran to a better place on the world stage.
Indeed, President Trump's tweets threatening 52 targets in Iran - one for each of the American hostages taken back in 1979 - seem to many observers to play right into the Iranian fundamentalist mindset by clinging to a history of grievance that seeks to avenge every wrong done by one side to the other.
Taken at face value, the approach offers the bleak possibility of unending violence as long as neither side offers a different path.
Mr Raab said he first became aware of the killing of Soleimani "as it happened" and spoke to US counterpart Mike Pompeo - who he will meet for pre-arranged talks in Washington this week - on Friday.
Mr Raab is also expected to meet his French and German counterparts before travelling to the US.
Mr Raab said the "important thing now is to de-escalate the tensions and try and restore some stability" - while trying to contain Iran's "nefarious actions".
"We also need to see that there's a route, a door left ajar for a diplomatic solution so that when the leadership in Tehran wake up to their options, they understand there is a positive route through for them."
Asked about the criticism over Mr Johnson being on holiday, Mr Raab said he had been "in constant contact with the prime minister over the Christmas break on a whole range of foreign policy issues".
Speaking on Sky's Sophy Ridge programme, shadow foreign secretary Emily Thornberry accused Mr Johnson of "sunning himself" while there had been three Cobra meetings where Mark Sedwill, the chief civil servant, had to chair.
Mr Johnson has yet to speak publicly about the US airstrike or threats from Iran.
HMS Montrose and HMS Defender will accompany UK-flagged ships through the Strait of Hormuz.
On Sunday, a crowd of more than 100 people waving Iranian and Iraqi flags protested against the killing of Soleimani outside the US embassy in London, with chants aimed at Mr Johnson and Mr Raab.
Mr Pompeo had criticised America's European allies for not being "helpful" in the wake of the killing but later tweeted he was "thankful that our allies recognise the continuing aggressive threats posed by the Iranian Quds Force".
Following the airstrike, the Foreign Office has hardened its travel advice for Britons in Iraq and Iran.
It said there is a risk British or British-Iranian dual nationals "could be arbitrarily detained or arrested in Iran".
The Foreign Office also said alerts for other parts of the Middle East were being increased, with calls for citizens to "remain vigilant" in nations including Afghanistan, Israel, Lebanon, Saudi Arabia and the United Arab Emirates.