United States President Donald Trump had a change of heart on Tuesday: he shied away from his threats to attack Iran's cultural sites if Tehran strikes back against US assets for the assassination of its top military officials.

UNESCO, the cultural agency of the United Nations, has called on governments to note that cultural sites are not targets, and attacking these is a war crime.

Trump backed down after first tweeting the warning and then reiterating it members of the press over the weekend, saying, "I like to obey the law." But he still seemed insulted by the suggestion that cultural sites are not to be 'touched' during an armed confrontation.

"Think of it," he said. "They are killing our people... and then with their heritage sites, we have to be very gentle? But with that, I'm okay. It's fine with me."

Trump then issued another stern warning to Iran, saying: "If Iran does anything they should not do, they are going to suffer the consequences, and very heavily."

Mike Esper, US Secretary of Defense, distanced the Pentagon from the President's threats to attack Iran's cultural sites despite international prohibitions on such actions.

According to Esper, the US would respect "armed conflict rules." Asked if that ruled out launching strikes against cultural sites, he stressed "it's the law on armed conflicts."

It all started during the weekend when Trump took to social media and said that if Iran targeted any American servicemen to avenge the death of Iranian General Qassem Soleimani, the US will attack 52 sites

across the country that "will be very hard and fast."

Anger spread rapidly through the Islamic Republic, and after vacationing at his Florida resort, Trump issued his warning again to reporters as he flew back to Washington on Sunday.

Tensions between the US and Iran escalated after Trump ordered a drone attack that killed Soleimani in a Baghdad airport in Iraq.

Soleimani is the leader of the elite Iranian Quds Force. The Pentagon has announced that Soleimani has been eliminated for plotting to kill US government officials and troopers in the Middle East.

Attacking heritage sites is a criminal offense under the Hague Convention of 1954. In 2017, a UN resolution condemning the destruction of cultural sites was passed unopposed by the Security Council. This vote was prompted by attacks by the Islamic State and other armed factions in Syria and Iraq.