US forces were given permission to conduct unilateral raid inside Pakistan if they knew where Bin Laden was hiding, officials say

After this story was published, the All Pakistan Muslim League issued a statement denying that there is any truth in the allegation that an agreement had been struck between then military leader of Pakistan, General Pervez Musharraf, and President George Bush, to let American forces conduct operations against bin Laden inside Pakistan.

The US and Pakistan struck a secret deal almost a decade ago permitting a US operation against Osama bin Laden on Pakistani soil similar to last week's raid that killed the al-Qaida leader, the Guardian has learned.

The deal was struck between the military leader General Pervez Musharraf and President George Bush after Bin Laden escaped US forces in the mountains of Tora Bora in late 2001, according to serving and retired Pakistani and US officials.

Under its terms, Pakistan would allow US forces to conduct a unilateral raid inside Pakistan in search of Bin Laden, his deputy, Ayman al-Zawahiri, and the al-Qaida No3. Afterwards, both sides agreed, Pakistan would vociferously protest the incursion.

"There was an agreement between Bush and Musharraf that if we knew where Osama was, we were going to come and get him," said a former senior US official with knowledge of counterterrorism operations. "The Pakistanis would put up a hue and cry, but they wouldn't stop us."

The deal puts a new complexion on the political storm triggered by Bin Laden's death in Abbottabad, 35 miles north of Islamabad, where a team of US navy Seals assaulted his safe house in the early hours of 2 May.

Pakistani officials have insisted they knew nothing of the raid, with military and civilian leaders issuing a strong rebuke to the US. If the US conducts another such assault, Prime Minister Yousaf Raza Gilani warned parliament on Monday, "Pakistan reserves the right to retaliate with full force."

Days earlier, Musharraf, now running an opposition party from exile in London, emerged as one of the most vocal critics of the raid, terming it a "violation of the sovereignty of Pakistan".

But under the terms of the secret deal, while Pakistanis may not have been informed of the assault, they had agreed to it in principle.

A senior Pakistani official said it had been struck under Musharraf and renewed by the army during the "transition to democracy" – a six-month period from February 2008 when Musharraf was still president but a civilian government had been elected.

Referring to the assault on Bin Laden's Abbottabad compound, the official added: "As far as our American friends are concerned, they have just implemented the agreement."

The former US official said the Pakistani protests of the past week were the "public face" of the deal. "We knew they would deny this stuff."

The agreement is consistent with Pakistan's unspoken policy towards CIA drone strikes in the tribal belt, which was revealed by the WikiLeaks US embassy cables last November. In August 2008, Gilani reportedly told a US official: "I don't care if they do it, as long as they get the right people. We'll protest in the National Assembly and then ignore it."

As drone strikes have escalated in the tribal belt over the past year, senior civilian and military officials issued pro forma denunciations even as it became clear the Pakistani military was co-operating with the covert programme.

The former US official said that impetus for the co-operation, much like the Bin Laden deal, was driven by the US. "It didn't come from Musharraf's desire. On the Predators, we made it very clear to them that if they weren't going to prosecute these targets, we were, and there was nothing they could do to stop us taking unilateral action.

"We told them, over and again: 'We'll stop the Predators if you take these targets out yourselves.'"

Despite several attempts to contact his London office, the Guardian has been unable to obtain comment from Musharraf.

Since Bin Laden's death, Pakistan has come under intense US scrutiny, including accusations that elements within Pakistan's Inter-Services Intelligence helped hide the al-Qaida leader.

On Sunday, President Barack Obama said Bin Laden must have had "some sort of support network" inside Pakistan.

"We don't know whether there might have been some people inside of government, outside of government, and that's something we have to investigate," Obama said.

Gilani has stood firmly by the ISI, describing it as a "national asset", and said claims that Pakistan was "in cahoots" with al-Qaida were "disingenuous".

"Allegations of complicity or incompetence are absurd," he said. "We didn't invite Osama bin Laden to Pakistan."

Gilani said the army had launched an investigation into how Bin Laden managed to hide inside Pakistan. Senior generals will give a briefing on the furore to parliament next Friday.

Gilani paid lip-service to the alliance with America and welcomed a forthcoming visit from the US secretary of state, Hillary Clinton, but pointedly paid tribute to help from China, whom he described as "a source of inspiration for the people of Pakistan".