Iran's Supreme Leader Ayatollah Ali Khamenei has called his country's missile strike on US targets in Iraq a "slap in the face" for the US and said Washington's troops must leave the region.

Khamenei's televised remarks on Wednesday came hours after the missiles were fired at the Ain al-Assad base in Anbar province and a facility in Erbil amid escalating tensions between Washington and Tehran following the US assassination of Iranian military commander Qassem Soleimani in Iraq last week.

More:

The Iraqi military said in an online statement that 22 missiles were launched on the two sites between 1:45am and 2:15am on Wednesday (22:45 GMT and 23:15 GMT on Tuesday). Two of the 17 missiles targeting Ain al-Assad base did not go off, the military said, while the five missiles on Erbil all targeted coalition headquarters.

The supreme leader had pledged severe retaliation against the US air strike that killed Soleimani as well as Abu Mahdi al-Muhandis, the deputy commander of Iraq's Popular Mobilisation Forces (PMF, or Hashd al-Shaabi), an Iran-backed umbrella organisation, among others.

"Last night we slapped them in the face," Khamenei said in his speech in the capital, Tehran, adding that military retaliation was not enough.

"What is important is that the corrupt presence of the US in this region should come to an end."

Khamenei was addressing a large crowd, many of whom were holding pictures of Soleimani, who headed Iran's Quds Force, the overseas arm of the elite Islamic Revolutionary Guard Corps (IRGC).

Soleimani was buried in the "martyrs section" of a cemetery in his hometown of Kerman after three days of funeral processions that saw his coffin travel to various cities across the country and huge crowds paying respects to him.

Before Soleimani's burial, a stampede erupted at the procession in Kerman, killing more than 50 people.

"I'm very sorry for that and I'm very sad for that," Khamenei said, referring to the stampede.

"I would like to express my condolences to their families ... I wish their spirits, their souls, join the soul of Soleimani," he said.

'Iran is equipped'

Following the missile strike, Foreign Minister Mohammad Javad Zarif said Iran had taken and concluded "proportionate measures in self-defence" under Article 51 of the UN Charter.

"We do not seek escalation or war, but will defend ourselves against any aggression," he said in a Twitter post.

In Washington, US President Donald Trump said in a tweet late on Tuesday that an assessment of casualties and damage from the strikes was under way.

"All is well!" Trump said in the Twitter post, adding that he would make a statement on Wednesday morning.

US officials have said Soleimani was killed because of intelligence indicating forces under his command planned attacks on US targets in the region. But they have not provided this intelligence.

Though it remains to be seen whether the attacks are the end of the latest escalation between the two nations, Iranian television reported a senior official in the Iranian supreme leader's office as saying that the missile attacks were the "weakest" of several retaliation scenarios.

Accusing the US of bringing "war and hostility" upon the region, Khamenei in his speech reiterated Iran's readiness to face threats.

"Today, we are armed. The nation of Iran is equipped against the bullies of the world," he said after praising Soleimani as a man of "bravery" and "effectiveness".

He paid tribute to the slain general's work in the region, referencing proxies in Iraq, Syria, and Lebanon.

"The role of our dear martyr was very bold and very important," Khamenei said of Soleimani, adding that he managed to halt US plans that were "prepared for the West Asia region."