The UK on Friday warned US President Donald Trump against outright war with Iran.

The foreign secretary, Dominic Raab, said that further conflict "is in none of our interests."

Iran and the US are on the brink of war after Trump ordered an airstrike that killed Iranian Maj. Gen. Qassem Soleimani late Thursday.

An adviser to Iranian President Hassan Rouhani said the US had crossed a "red line," and the country's supreme leader, Ayatollah Ali Khamenei, warned of "harsh retaliation."

The UK government on Friday urged President Donald Trump to step back from outright war with Iran after a US airstrike killed Iran's elite Quds Force commander, Maj. Gen. Qassem Soleimani, warning that further conflict in the region "is in none of our interests."

The foreign secretary, Dominic Raab, said in a statement that while the UK "recognised the aggressive threat posed by the Iranian Quds force led by Qasem Soleimani," it urged "all parties to de-escalate."

He added that "further conflict is in none of our interests."

The leader of the opposition Labour Party, Jeremy Corbyn, also called on the UK government to "stand up to the belligerent actions and rhetoric coming from the United States."

He added: "All countries in the region and beyond should seek to ratchet down the tensions to avoid deepening conflict, which can only bring further misery to the region, 17 years on from the disastrous invasion of Iraq."

The UK and other allies were not informed in advance about the US's decision to assassinate Soleimani, BuzzFeed News reported.

Tom Tugendhat, the chair of Parliament's Foreign Affairs Committee, told the BBC that it was a "matter of concern" that the information had been withheld from US allies.

"It's been a pattern, sadly, which has been a bit of a shame, that the US administration of late has not shared with us and that is a matter of concern," Tugendhat said.

"I would urge the US administration to share much more closely with allies, particularly those who are fighting alongside in the region, including us."

The UK, along with the rest of the European Union, had championed the multilateral 2015 nuclear deal with the Iranian government and criticised Trump's decision to withdraw from it in May 2018.

Raab's warning against further conflict came after Iran threatened "harsh retaliation" for the killing of Soleimani late Thursday.

In a statement on state television, Iranian Supreme Leader Ayatollah Ali Khamenei declared a three-day mourning period for the commander and threatened imminent retaliation against the US. An adviser to Iranian President Hassan Rouhani said the US had crossed a "red line."

The US government believes Soleimani was responsible for the deaths of hundreds of US service members and insisted he was planning additional attacks that threatened US personnel and interests in the region.

"This strike was aimed at deterring future Iranian attack plans," the Department of Defense said.