Pakistan’s military has lost more than 3,000 security personnel in the fight against terrorism. Such sacrifices are often overshadowed in the U.S., where the media (rightly) focus on Pakistan’s lack of action against groups like the Haqqani network that targets U.S. forces in Afghanistan and the Lashkar-e-Tayyiba, responsible for the terrorist atrocities in Mumbai in November 2008.

While Pakistani military leaders seem to believe they can handle the terrorist threat to their own country without targeting all of the terrorist groups that find sanctuary there, the recently released Osama bin Laden files tell a different story. The bin Laden documents reveal the extremist network inside Pakistan is pervasive and resilient and, most importantly, unified in its commitment to an ideology that demands permanent war with the West.

Unless Pakistan’s military leaders awaken to the dangers that lie ahead from the Islamist extremist threat and recognize their best hope for confronting it lies in forming an effective partnership with the U.S., the threat may eventually overwhelm the Pakistani state.

The most striking example of Pakistani inadequacy against the terrorist threat lies in bin Laden’s ability to hide undetected in the country for as long as he did. As former Pakistani Ambassador to the U.S. Husain Haqqani (no relation to the Haqqani network) points out in his op-ed in today’s New York Times, Pakistanis are still in the dark about who enabled bin Laden to shelter inside the country. Haqqani calls on the Pakistani courts to focus on identifying, arresting, and prosecuting the individuals who facilitated bin Laden’s lengthy stay in Pakistan.

Based on credible media reports from last year, one of the individuals who may have helped bin Laden is terrorist leader Fazlur Rehman Khalil, who heads the notorious Harakat ul-Mujahideen (formerly the Harakat ul-Ansar). Since the HuM has been part of the network of terrorist groups attacking India, Pakistani authorities have been reluctant to take action against Khalil. But it is precisely this segmented approach to terrorism that allowed bin Laden to shelter in Pakistan and which may eventually enable the terrorist network inside Pakistan to gain the upper hand against the security forces.

The letters from Abbottabad reveal a complicated and somewhat fraught relationship between the Tehrik-e-Taliban Pakistan (TTP) and al-Qaeda, but a relationship nonetheless. The TTP has been responsible for most of the attacks against Pakistanis over the last four years, which have led to thousands of civilian and security personnel deaths and an overall weakening of the Pakistani state.

Interestingly, bin Laden was apparently not informed ahead of time about the TTP-backed attempted car bombing of Times Square in May 2010. However, the letters show there was communication between the groups and that they adhere to the same overall objectives and ideology.

The U.S.–Pakistan partnership has been badly frayed over the last year. Despite both sides’ desire to avoid an implosion of ties, Pakistan’s reluctance to change course on its policies toward Islamist terrorist groups is blocking efforts to repair relations.

There almost certainly is a tussle within the Pakistani security establishment about where Pakistan’s future interests lie—in a close anti-terrorism partnership with the U.S. or in continuing to play games with the network of deadly terrorist groups roaming the country. Meanwhile, with each passing the day, the chance grows that these groups will be able to exploit Pakistan’s political, ethnic, and sectarian divisions in service of their own extremist agenda.

The U.S. has demonstrated its commitment to taking action against al-Qaeda and its affiliate organizations. It is up to Pakistan to decide whether it works with or against the U.S. in this endeavor.