When a suicide car bomb killed scores of people at the gate of the Indian Embassy in Kabul this week, the shock waves reached Washington.
The attack was a grim reminder that Pakistan's army and military intelligence are still more worried about archenemy India than about curbing militants in their own country. This poses a huge problem for Afghanistan and for the United States.
The Bush administration is increasingly nervous about radical militants who now control much of Pakistan's border area with Afghanistan.
Al-Qaida now bases there, working with Pakistani terrorist groups and the Afghan Taliban. Cross-border attacks into Afghanistan are on the rise.
Afghan officials blamed an unnamed foreign intelligence agency for the embassy attack. They clearly meant Pakistan's Inter Services Intelligence Agency, or ISI, which they recently accused of mounting an assassination attempt on Afghan President Hamid Karzai.
Pakistan has denied both allegations, and its foreign minister, Makhdoom Shah Mahmood, condemned the attack. He was probably sincere.
But Pakistan's well-meaning civilian government is weak and divided and still getting its act together. Emerging from years of military dictatorship, elected officials don't control the army or ISI.
Those bodies report to President Pervez Musharraf, who led a coup in 1999 and only recently took off his general's uniform. He is now a lame duck whose power has dramatically shrunk.
So it's unclear who now controls the military or ISI operatives, who have longstanding relationships with radical Islamists in Pakistan's tribal areas.
The ISI helped train Pakistani and foreign militants to fight Soviet troops in Afghanistan in the 1980s with U.S. and Saudi funding. After the Soviets left, the ISI helped the Taliban take over Afghanistan; when the Taliban fled to Pakistan, the ISI maintained its ties.
Why won't the Pakistani military and ISI now confront the militants who are destabilizing Afghanistan and also threatening Pakistan's security? The central answer can be summed up in three words: fear of India.
"Afghanistan is ... a theater for the struggle between India and Pakistan," I was told by New York University's Barnett Rubin, a top expert on Afghanistan. The military is focused on the conflict with India, not the Islamist threat.
Pakistan is squeezed between India and Afghanistan. Its military views ties with the Taliban as a hedge against the growing influence of India in Kabul, from which it could meddle in Pakistan. (Pakistani generals remember that India helped Eastern Pakistan secede and become Bangladesh.)
The ISI has trained Pakistani militants to fight Indian troops in the disputed region of Kashmir. The Pakistani military's nightmare, says Rubin, is that the United States "will abandon Pakistan and ally with India."
The military's nervousness is fueled by India's role as one of Afghanistan's largest aid donors. Rubin notes the consistent pattern of attacks on Indian road-building teams in southwest Afghanistan (these roads would make Afghans less dependent on Pakistan).
Pakistan's military is also paranoid about India's establishment of nine consulates in Afghanistan, which it fears will be used to encourage separatist movements in Pakistan. And it is suspicious of Karzai, who is seen as too friendly to New Delhi.
To its credit, Pakistan's civilian government understands the need to improve relations with India. If Pakistan and India could make progress on the Kashmir issue, this might undercut the military's obsession with the Indian threat.
But attacks against Indian targets "seem designed to sabotage any improvement of relations between Pakistan and its two neighbors, India and Afghanistan," says Rubin. Just prior to the first high-level diplomatic meeting between Pakistan's civilian government and India, nine bombs killed 63 people in the Indian city of Jaipur.
Clearly, Pakistan's government needs help in jump-starting crucial diplomacy with India. Given improved U.S.-Indian relations, the White House and the next president should try to quietly move India and Pakistan toward agreement on Kashmir.
Washington should also ensure that billions in military aid to Pakistan goes for counter-insurgency training, not heavy weapons suited for war with India.Until Pakistan's military and ISI can be weaned from their India fixation, the jihadi threat there will keep growing. That malignancy threatens us all.
Trudy Rubin is a columnist and editorial-board member for the Philadelphia Inquirer. (Barnett Rubin and Trudy Rubin are not related.) E-mail: firstname.lastname@example.org.