An American soldier and a British soldier, as well as one US contractor, were killed on Wednesday after rockets hit an Iraqi military base north of Baghdad, according to the US military official.

It was the deadliest attack on an installation hosting foreign troops in several years and comes after a spate of rocket attacks targeting US troops across Iraq as well as the US embassy in Baghdad.

No group has claimed the responsibility for the attack but Washington has blamed Iran-backed factions for similar attacks.

Earlier, the Iraqi army had said that the attack against the Taji base did not wound anyone or cause any damage, in what was the 22nd attack against American military interests in the country since late October.

Earlier this year, the attack at the Baghdad International Airport also killed Abu Mahdi al-Muhandis, the deputy commander of Iran-backed militias known as the Popular Mobilisation Forces (PMF).

Iran’s Supreme Leader Ayatollah Ali Khamenei swiftly pledged to take “severe revenge” for Soleimani’s assassination.

Iran fired more than a dozen missiles at two Iraqi bases that house US forces. US and Iraqi officials said there were no casualties.

The Iranian attack came after a US drone attacked on January 3 a convoy at Baghdad International Airport that killed Qassem Soleimani, commander of the Quds Force of Iran’s Islamic Revolution Guards Corps, and Abu Mahdi al-Muhandis, deputy chief of Iraq’s paramilitary Hashd Shaabi forces.

More than 5,000 US troops have been deployed in Iraq to support the Iraqi forces in the battles against Islamic State militants.

The US leads an international coalition — comprised of dozens of countries and thousands of soldiers — formed in Iraq in 2014 to confront the Islamic State, a jihadist group that Baghdad declared defeated in late 2017.

The Iraqi parliament voted to expel all foreign soldiers from the country in the wake of the killing of Soleimani, a decision that must be executed by the government.

The outgoing government, which resigned in December in the face of mass protests, has yet to be replaced due to a lack of agreement in parliament — one of the most divided in Iraq’s recent history.

(With inputs from agency)