Boys collect debris Tuesday where a helicopter carrying U.S. troops crashed outside the hideout of al-Qaeda leader Osama bin Laden in Abbottabad,Pakistan. The compound has been kept under tight control by Pakistan’s army since the raid.

ISLAMABAD — Friend. Foe. Or both. Osama bin Laden’s use of the military city of Abbottabad as his final hideout aggravates a familiar suspicion among U.S. policymakers: that Pakistan paints itself as a reliable ally against militants even while officials help some of them behind the scenes when it suits their interest.

Pakistan’s security establishment and government have always vehemently denied playing such a double game — particularly in the case of bin Laden and other al-Qaeda figures.

But analysts say Pakistan’s willingness to reach an accommodation with militants who further its national aims is a cornerstone the country’s regional strategy and is unlikely to change. Just as constant is its mutual dependence with the United States, despite a long history of anger and frustration. Pakistan needs U.S. aid; Washington needs Pakistan’s help winding down the war in Afghanistan.

And U.S. officials do not want to see Pakistan turn into a failed state that is home to both a broad array of extremist groups and an arsenal of nuclear weapons.

“No one has any illusions about this alliance, especially now,” said a senior U.S. military officer. “But the reality remains: We are much more likely to achieve our aims by working with them where we can.”

Pakistani officials say they regard al-Qaeda as being every bit as dangerous as the Americans do and point out their role over the years in apprehending a number of key figures. Among them was Khalid Shaikh Mohammed, who claims to have planned the 2001 terrorist attacks in the United States.

Its approach to other groups is more nuanced. Pakistani intelligence agencies are widely suspected of keeping close relations with groups that target rival India, including Lashkar-e-Taiba, which is accused of organizing the attack on Mumbai in 2008 that killed 166 people.

One of the best examples is its handling of the al-Qaeda-allied Taliban factions that maintain strongholds in the country’s tribal regions along the Afghan border.

The army has launched offensives against the Pakistani Taliban, a homegrown insurgency that directs most of its attacks on security installations, mosques and markets within Pakistan. But it leaves untouched factions such as the Haqqani network, which focuses its attacks exclusively on U.S., NATO and Afghan security forces in Afghanistan.

Most observers believe Pakistan maintains ties with the Afghan Taliban and the Haqqani network with an eye to the future.

Pakistan hopes to exert increased influence on Afghanistan once the U.S. completes its military withdrawal in 2014, and it expects both organizations will play vital roles in Afghanistan’s future. But many Pakistanis also fear any offensive against the Haqqani network would cause militant groups in the tribal areas to unleash violence within Pakistan.

Ignorance of bin Laden’s whereabouts may be Pakistan’s best defense when it comes to Washington. But it’s not going down well with the Pakistani public, which expects more from its military establishment. And in any case, many in Washington doubt the picture is that clear cut.

“It’s either someone was aware (of bin Laden’s whereabouts) and didn’t pass it along, or the ISI (the Directorate for Inter-Services Intelligence) decided it didn’t want to know, or gross negligence by the police and military,” said a former U.S. Defense Department official who recently left the government and has familiarity with recent intelligence assessments of Pakistan.

A senior Pakistani intelligence official who spoke on the condition of anonymity called allegations that Pakistan knew where bin Laden was “hogwash.”

“Had we known he was there, we would have captured him ourselves,” the official said. “Just imagine for an instant what impact it would have on the image of Pakistan in the U.S., which at the moment is at its lowest, had we captured him and handed him over to the U.S.

“Yes, it slipped from our radar,” the official added. “Yes, that can be embarrassing. But it’s not something that should be held against us.”

More in News

A wedding and special events’ planning business has agreed to pay a $200,000 settlement to five employees living in the country illegally after allegedly failing to pay them minimum wages and overtime and discriminating against them because of their race.

The CIA has concluded in a secret assessment that Russia intervened in the 2016 election to help Donald Trump win the presidency, rather than just to undermine confidence in the U.S. electoral system, according to officials briefed on the matter.