Earlier this year, U.S. Secretary of State John Kerry declared all terrorism in Pakistan “unacceptable” and offered $250 million to aid refugees displaced by the Pakistani military offensive against Tehrik-e-Taliban Pakistan (TTP) militants in North Waziristan.

The Pakistani military has repeatedly tried to assure Washington that it is committed to cracking down on all terrorist groups in its territory, but so far there are few signs that it is ready to confront those groups that fight in Afghanistan and India. In its fight against the TTP insurgency, the army claims it has killed more than 2,000 militants since June of 2014, significantly weakening the terrorists’ foothold in Pakistan. This is certainly welcome, and the Pakistan military deserves credit for taking the fight to the TTP.

According to The Heritage Foundation’s 2015 Index of U.S. Military Strength, however, terrorism originating in Pakistan and Afghanistan remains an “elevated” threat to vital American interests.

Only this month, the Islamabad High Court, in all likelihood having been strong-armed by the military leadership, rejected Pakistani government arguments and ordered the release of Zaki-ur-Rehman Lakhvi, the Lashkar-e-Taiba (LeT) mastermind of the 2008 Mumbai terrorist attacks that killed nearly 160, including six Americans.

Last December, two days after the horrific TTP attack on a military school in Peshawar that killed nearly 130 children, Pakistan’s Anti-Terrorism Court granted bail to Lakhvi. This stunning development was likely a signal from the Pakistan military to India that it would retain the LeT as a tool, even as it cracked down on the TTP.

Ultimately, the military probably will keep Lakhvi in jail because Pakistani officials understand that releasing him could cost hundreds of millions in U.S. aid to Pakistan. But the signal that the bail plea sends about the military’s intentions to continue relying on the LeT is cause for deep concern.

The Pakistan army’s risky double game of selectively supporting some terrorist groups threatens U.S. national security objectives of rooting out global terrorism from South Asia. So long as Pakistan’s military allows groups that follow an extremist Islamist ideology to operate freely, they make their territory an environment in which global terrorism can flourish.

In addition to fostering global terrorism, Pakistan’s dual policies toward terrorism raise the chances of another Indo–Pakistani conflict that could potentially go nuclear, a major point highlighted in Heritage’s Index of U.S. Military Strength.

The Index further highlights the dangers of the Pakistan military establishment’s links to terrorist groups when it comes to keeping Pakistan’s nuclear assets safe and secure. The Index recounts several significant terrorist attacks on Pakistani military sites in the past few years that are indicative of the country’s vulnerability when it comes to keeping its nuclear facilities safe from infiltration or possible terrorist theft. As the Index notes, “The realization that Osama bin Laden stayed for six years within a half mile of Pakistan’s premier defense academy has fueled concern that al-Qaeda can operate relatively freely…and gain access to Pakistan’s nuclear arsenal.”

This is a concern on both sides of the aisle in Congress. In a joint letter to Secretary Kerry, House Committee on Foreign Affairs Chairman Ed Royce (R–CA) and Ranking Member Eliot Engel (D–NY) voiced concern that Pakistan has not done all it could to root out terrorist groups such as LeT, Lashkar-e-Jhangvi, and Jaish-e-Muhmmad because they are seen as serving Pakistan’s foreign policy goals in India and Afghanistan.

Congress urged the State Department to change course on its policy toward Pakistan by imposing foreign aid cuts, sanctions, and bans on travel to the U.S. by any Pakistani official suspected of aiding terrorist groups.

Pakistan’s selective approach to fighting terrorism continues to undermine U.S. national security objectives in the region. If Pakistan is indeed serious about combatting terrorism, it must come down hard on all terrorist groups and break all links with terrorists operating in Afghanistan and India. U.S. policy must insist on this outcome.