IRAN has struck back at the United States for killing a top Revolutionary Guard commander, firing ballistic missiles at two military bases in Iraq that house American troops.

The attack was a major escalation between the two long-time foes and Iran's most direct assault on America since the 1979 seizing of the US embassy in Tehran.

Iranian state TV said it was in revenge for the US killing of General Qassem Soleimani, whose death last week in an American drone strike near Baghdad prompted angry calls to avenge his killing.

US and Iraqi officials said there were no immediate reports of casualties, though buildings were still being searched. The Iraqi government later confirmed there were no casualties among Iraqi forces.

A presenter on Iranian state television later claimed, without offering evidence, that the strikes killed "at least 80 terrorist US soldiers" and also damaged helicopters, drones and other equipment at the Ain al-Asad air base.

READ MORE: Iran: 176 people killed in Ukraine Boeing plane crash near Tehran

READ MORE: These are the profound implications of the killing of Qasem Soleimani​

The strikes, which came as Iran buried Gen Soleimani, raised fears that the two foes were closer to war. But there were some indications that there would not be further retaliation on either side, at least in the short term.

US president Donald Trump tweeted "All is well!" shortly after the missile attacks, adding "So far, so good" regarding casualties.

Moments earlier, Iran's foreign minister tweeted that Tehran had taken and "concluded proportionate measures in self-defence", adding that Tehran did "not seek escalation" but would defend itself against further aggression.

In Tehran, Supreme Leader Ayatollah Ali Khamenei called the missile strike on the US bases in Iraq a "slap in the face" of the Americans, adding that military retaliation is not sufficient.

"The corrupt presence of the US in the region should come to end," he said.