The SAS planned to assassinate Iranian military chief Qassim Soleimani during the Iraq War but were stopped by a personal intervention from Labour foreign secretary David Miliband.

The Daily Telegraph has learnt that British special forces were ready to kill Soleimani in 2007 when he was identified as the man running the campaign against UK troops in the southern port city of Basra.

The SAS had him in their “crosshairs”, sources said, but Mr Miliband called off the operation, meaning Soleimani survived until he was killed on Friday morning in a US drone strike.

It emerged that Boris Johnson was given no advance warning of Friday’s US rocket attack in Baghdad despite Britain having hundreds of soldiers stationed in the area.

Government sources have told The Telegraph it caught Downing Street and the whole of Whitehall “by surprise”, causing anger among ministers who had to scramble to react to the rapidly-escalating crisis.

The failure by the US to alert Britain to an attack happening just 40 miles from where 500 Army personnel are stationed raised questions about the strength of US-UK relations as Donald Trump bids for a second term in power.

Soleimani, the commander of the elite Quds Force unit of Iran's Revolutionary Guard, was found to be running a campaign by Iranian-backed Shia militias in southern Iraq in 2007 to carry out terrorist attacks against British troops based in Basra.