US President Donald Trump on Tuesday backed away from his threats to target Iranian cultural sites if Iran retaliates against the United States for killing one of its top generals.

Targeting cultural sites is a war crime.

Trump on Saturday tweeted that the US had 52 Iranian sites, including ones that are very important to Iranian culture, it could attack if Iran attacks Americans or US assets.

The tweet came amid escalating tensions between the two countries following the Trump-ordered US killing of Iranian military commander Qassem Soleimani in Iraq.

More:

Trump, speaking to reporters in the Oval Office on Tuesday, made clear he would reluctantly abide by the law.

"You know what, if that's what the law is, I like to obey the law. But think of it: They kill our people, they blow up our people and then we have to be very gentle with their cultural institutions. But I'm OK with it. It's OK me," he said.

"I will say this: if Iran does anything that they shouldn't be doing, they're going to be suffering the consequences and very strongly," he added.

....targeted 52 Iranian sites (representing the 52 American hostages taken by Iran many years ago), some at a very high level & important to Iran & the Iranian culture, and those targets, and Iran itself, WILL BE HIT VERY FAST AND VERY HARD. The USA wants no more threats! — Donald J. Trump (@realDonaldTrump) January 4, 2020

On Monday, US Defense Secretary Mark Esper suggested that the US military would not violate the laws of armed conflict by striking Iranian cultural sites.

Asked whether he was willing to target cultural sites, Esper told Pentagon reporters: "We will follow the laws of armed conflict."

Pressed on whether he would then not target such sites, because that would be a war crime, Esper said: "That's the laws of armed conflict." He did not elaborate.

Targeting cultural sites with military action is considered a war crime under international law, including a UN Security Council resolution supported by the Trump administration in 2017 and the 1954 Hague Convention for the Protection of Cultural Property.

The US drone attack on Friday that killed Soleimani has raised fears of all-out conflict. Washington says it killed Soleimani in self-defence, aiming to disrupt his plans to attack US personnel and interests.

US Defense Secretary Mark Esper speaking during a press briefing in the Pentagon in Arlington, Virginia, US [Yuri Gripas/Reuters]

Earlier on Tuesday, Esper said the US wants to de-escalate tensions with Iran, but the country is ready to finish any war that could be started.

"We are not looking to start a war with Iran, but we are prepared to finish one," he said. "What we'd like to see is the situation de-escalated."

Esper defended the intelligence signalling an "imminent threat" from Soleimani that he and other senior US officials have cited to justify the assassination, saying it was persuasive.

"The threat was being orchestrated by Soleimani," Esper said. "I think it was only a matter of days, certainly no more than weeks" before an attack.

He added that the US should expect some form of Iranian retaliation.

"I think we should expect that they will retaliate in some way, shape or form," Esper told a news briefing at the Pentagon, adding that such retaliation could be through Iran-supported groups outside of Iran or "by their own hand".

"We're prepared for any contingency. And then we will respond appropriately to whatever they do."