US President Donald Trump has ratcheted up his rhetoric against Iran and Iraq, warning of a "major retaliation" if Iran strikes back in reprisal for the US's assassination of one of its top military commanders and threatening sanctions on Iraq after its parliament called on US troops to leave the country.

Trump and his advisers have been defending the drone attack that killed Iranian military commander Qassem Soleimani, escalating tensions in the region.

Trump says Soleimani was planning attacks against US citizens and that he would consider releasing intelligence reports that led him to direct the killing.

More:

Asked on Air Force One about potential retaliation by Iran, Trump said: "If it happens, it happens. If they do anything, there will be major retaliation."

Trump, who spoke to reporters on his way back to Washington from a holiday in Florida, has said Soleimani was killed to avoid war with Tehran and warned against further escalation.

But he has deployed aggressive rhetoric in public, tweeting that the US would target 52 Iranian sites, some "at a very high level & important to Iran & the Iranian culture" if Iran struck any US citizens or assets in retaliation.

'Surrounded by hawks'

US Secretary of State Mike Pompeo denied on Sunday that Trump said he would target Iranian cultural sites but the president contradicted him when asked about the issue on Sunday night.

"They're allowed to use roadside bombs and blow up our people and we're not allowed to touch their cultural sites? It doesn't work that way," he said.

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-based Human Rights Watch said on Sunday that Trump's threat to attack sites of cultural importance would be war crimes if carried out.

"President Trump should publicly reverse his threats against Iran’s cultural property and make clear that he will not authorize nor order war crimes," said Andrea Prasow, acting Washington director at Human Rights Watch. "The US Defense Department should publicly reaffirm its commitment to abide by the laws of war and comply only with lawful military orders."

Trump and First Lady Melania Trump, gets off Air Force One after a holiday at his Mar-a-Lago estate in Florida. Speaking to reporters on the plane, he stepped up his rhetoric against Iran and threatened sanctions on Iraq [Kevin Wolf/AP Photo]

The president also issued a threat to Baghdad after the Iraqi parliament backed a resolution calling for US and other foreign troops to leave the country.

Trump said if Iraq asked US forces to leave and it was not done on a friendly basis, "we will charge them sanctions like they've never seen before ever. It'll make Iranian sanctions look somewhat tame."

"We have a very extraordinarily expensive airbase that's there. It cost billions of dollars to build, long before my time. We're not leaving unless they pay us back for it," Trump told reporters.

Nader Hashemi, director of the Center for Middle East Studies at the University of Denver told Al Jazeera Trump's comments were "borderline insane" and a cause for concern.

"This is someone who is completely surrounded by war hawks, is driven by his ego and is in a re-election campaign," Hashemi said. "I think he's calculating that this type of tough rhetoric plays well with his domestic base."