Tensions between the United States and Iran have escalated dramatically after a top Iranian military commander Qassem Soleimani was killed last week in a US air strike in Iraq.

Iran fired more than a dozen ballistic missiles at two Iraqi military bases hosting US troops early on Wednesday, a move it said was in retaliation to Soleimani's assassination on January 3.

More:

Washington argues it killed Soleimani, who headed Iran's elite Quds Force, in self-defence, aiming to disrupt his plans to attack US personnel and interests.

Iran's Supreme Leader Ayatollah Ali Khamenei had pledged to take "severe revenge" for Soleimani's death, the biggest escalation yet in a feared proxy war between the US and Iran in Iraq, where Washington and Tehran have vied for influence since the US-led invasion in 2003.

While the US has maintained a military presence in the country, leading a coalition to fight the ISIL (ISIS) group, Iran wields vast influence over Iraqi politics and also backs a number of Iraqi militias within the Popular Mobilisation Forces (PMF), an umbrella of armed groups. The militias have long sought the withdrawal of US forces from Iraq.

Amid growing fears of a broader conflict in the region, here is a recap of the recent events.

US contractor killed

On December 27, a rocket attack on an Iraqi military base in Kirkuk killed a US contractor and wounded several US service members and Iraqi personnel.

In its statement confirming the attack, the US-led coalition against the ISIL did not specify who might be responsible, but US officials later blamed Kataib Hezbollah, an Iran-backed militia, for the attack.

US targets militia sites

Two days later, the US military carried out "defensive strikes" on sites in Iraq and Syria belonging to Kataib Hezbollah that Washington said was in retaliation for the killing of the US contractor.

Iraqi security and militia sources said at least 25 fighters were killed and 55 others wounded following the air attacks in Iraq on Sunday.

191230160258530

At least four Kataib Hezbollah commanders were among the dead, the sources said, adding that one of the raids had hit the Iran-backed group's headquarters near the western al-Qaim district on the border with Syria.

Iran strongly condemned the attacks with a government spokesman saying: "America has shown its firm support for terrorism and its neglect for the independence and sovereignty of countries and it must accept consequences for its illegal act."

Protesters storm US embassy

On December 31, enraged members and supporters of pro-Iranian paramilitary groups in Iraq, broke into the heavily fortified US embassy compound in Baghdad, smashing a main door and setting parts of its perimeter on fire.

US President Donald Trump blamed Iran for killing the US contractor and the ensuing tensions around the embassy.

"Iran is orchestrating an attack on the US Embassy in Iraq. They will be held fully responsible," he wrote on Twitter.

....Iran will be held fully responsible for lives lost, or damage incurred, at any of our facilities. They will pay a very BIG PRICE! This is not a Warning, it is a Threat. Happy New Year! — Donald J. Trump (@realDonaldTrump) December 31, 2019

US troops and Iraqi security forces fired tear gas and stun grenades at the protesters - PMF members and their supporters - who had encircled the embassy compound.

The sit-in ended on January 1.

A protester holds a placard with US President Donald Trump illustration burning outside the US embassy during a protest in Baghdad on January 1, 2020 [File: Khalid al-Mousily/Reuters]

Meanwhile, on January 2, US Secretary of Defense Mark Esper said there were "some indications" that Iran or groups it supports "may be planning additional attacks" on US interests in the Middle East.

"If that happens then we will act and by the way, if we get word of attacks or some type indication, we will take pre-emptive action as well to protect American forces to protect American lives," the Pentagon chief told reporters.

Soleimani assassination

On January 3, a pre-dawn US air strike near Baghdad's international airport killed Soleimani, Iraqi militia commander Abu Mahdi al-Muhandis and several others.

A three-day national mourning period ended in Iran on Tuesday, as thousands gathered for Soleimani's burial in his hometown of Kerman, a day after huge crowds took part in an emotionally-charged funeral procession in Tehran and the holy city of Qom.

Coffins of Soleimani and others who were killed in Iraq by a US drone strike , are carried on a truck surrounded by mourners during a funeral procession, in the city of Kerman, Iran, on January 7, 2020 [Erfan Kouchari/Tasnim News Agency via AP]

War of words

A highly-charged rhetoric from Washington and Tehran followed Soleimani's killing, prompting calls for de-escalation and diplomacy from world leaders and the United Nations.

Iran's Khamenei said "a harsh retaliation is waiting", while Trump threatened to hit 52 Iranian sites "very hard" if Tehran attacked US citizens or assets.

Iranian Foreign Affairs Minister Mohammad Javad Zarif warned the US that its days in the region are "numbered".

"Iran will respond because there was an act of war - an act of war combined with an act of terrorism against a senior official of the Islamic Republic of Iran and a citizen of Iran," Zarif told Al Jazeera in an interview on Tuesday.

Iran's parliament also unanimously passed a bill on Tuesday designating all US forces as "terrorists".

Iran fires back at US targets

In the early hours of Wednesday, Iran launched more than a dozen missiles from its territory against at least two Iraqi facilities hosting US-led coalition personnel, the Pentagon confirmed.

Iranian state television said the Islamic Revolutionary Guard Corps (IRGC) had attacked Ain al-Assad military base, where US troops are stationed. A second facility near Erbil airport was also hit.

The Iraqi military said in a statement that 22 missiles were launched on the two sites between 1:45am and 2:15am. 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.