Donald Trump has responded on Twitter to US officials confirming the assassination of a top Iranian general, simply by tweeting an image of an American flag.

Late on Thursday, the Pentagon said in a statement that it had carried out airstrikes against Qassem Soleimani, the leader of the Iranian Revolutionary Guard Corps' Quds Force.

The operation also killed the leader of a key Iraqi militia force, Abu Mahdi al-Muhandis, who was travelling with Soleimani at the time.

“At the direction of the president, the US military has taken decisive defensive action to protect US personnel abroad by killing Qassem Soleimani, the head of the Iranian Revolutionary Guard Corps-Quds Force, a US-designated Foreign Terrorist Organisation,” said the statement.

“General Soleimani was actively developing plans to attack American diplomats and service members in Iraq and throughout the region.

"General Soleimani and his Quds Force were responsible for the deaths of hundreds of American and coalition service members and the wounding of thousands more.”

Iranian foreign minister Mohammad Javad Zarif said on Friday the assassination of Soleimani was “an extremely dangerous and foolish escalation”.

Protesters gather outside the US embassy in Iraq

“The US bears responsibility for all consequences of its rogue adventurism,” he said.

The president, who is currently at his Mar-a-Lago estate in Florida, did not make any official comment or statement, as some had predicted.

However, at almost precisely the moment the Pentagon confirmed it was behind the strike at Iraq’s Baghdad airport, Mr Trump tweeted an image of a US flag.

For once, Mr Trump’s post contained no words.