The UK and US have vowed to hold to account those responsible for a fatal attack on a coalition military base in Iraq.

A British soldier was killed alongside two Americans in the rocket attack on Taji base, with a dozen more personnel injured.

US Secretary of State Mike Pompeo said the attack would “not be tolerated”, while Foreign Secretary Dominic Raab said it was a “cowardly” act.

The Iraqi military has opened an investigation into the attack, which came amid mounting tensions between the US and Iran.

The attack coincided with what would have been the birthday of Iranian general Qassem Soleimani, who was killed in a US drone strike in January.

The British soldier killed in the Taji attack was a member of the Royal Army Medical Corps.

Mr Raab and Mr Pompeo have discussed the attack and how to respond.

Mr Pompeo said they had agreed “those responsible must be held accountable”.

Mr Raab said: “We will defend against these deplorable acts and hold those responsible to account.”

Prime Minister Boris Johnson said: “We will continue to stay in close contact with our coalition partners to establish exactly what happened.”

Defence Secretary Ben Wallace called the attack a “cowardly and retrograde act”.

He added: “We shall not forget their sacrifice and will ensure those who committed these acts face justice.

US military spokesman Colonel Myles Caggins said 12 more people from the Combined Joint Task Force Operation Inherent Resolve were injured when more than 15 small rockets hit the base on Wednesday.

Taji air base is used as a training site for coalition forces.

One witness told the PA news agency he heard screams of panic at the base as sirens rang out.

Ali Al Dulaimy, a 28-year-old Iraqi journalist, filmed the attack from the town of Balad to the north of Taji.

Speaking to PA in Arabic through a translation tool, he said: “I heard screams and panic at the American forces inside the camp, and they were rushing to extinguish the fires that devoured the camp.

“There were soldiers shouting and sirens. It was in an agricultural area 10km near the camp.”

He added the rockets appeared to have been fired at “precise” targets.

In January, the MoD told the PA news agency there were around 400 personnel in Iraq across three main bases – Camp Taji near Baghdad, Union III in Baghdad, and Erbil in Iraqi Kurdistan.

Officials did not say what group they believe launched the rocket attack, but Kataib Hezbollah or another Iranian-backed Shia militia group is likely.

Kataib Hezbollah was responsible for a rocket attack on a military base in Kirkuk in December that killed a US contractor, prompting American military strikes in response.

It led to protests at the US embassy in Baghdad which was followed on January 3 by the air strike that killed Soleimani and Abu Mahdi al-Muhandis, a leader of the Iran-backed militias in Iraq, of which Kataib Hezbollah is a member.

Kataib Hezbollah has been designated a “foreign terrorist organisation” by the US State Department since 2009.