Events of the past few weeks have been a reminder that the road to winning the war in Afghanistan winds through Pakistan.

To some extent that's literally the case: Pakistan closed a key supply route for the US-led NATO effort in Afghanistan after a US helicopter opened fire on a Pakistani border post on Sept. 30 and killed three Pakistani soldiers.

Since then, an angry Islamabad has relaxed security on its side of the border and Taliban-linked militants have descended on NATO convoys backed up near the closed Torkham crossing, the gateway to the Khyber pass into Afghanistan. They've burned dozens of fuel tankers and trucks and killed at least three of their drivers.

The United States and NATO have since apologized for the incident, but President Obama's administration continues to appear furious at what they see as Pakistani double-dealing.

In a report to Congress last week, Mr. Obama's National Security Council said that Pakistan "continued to avoid military engagements that would put it in direct conflict with the Afghan Taliban or Al Qaeda forces in North Waziristan." It added that "this is as much a political choice as it is a reflection of an under-resourced military prioritizing its targets."

That's evidence of the longstanding problem between the US and Pakistan.

The report, along with the temporary roadblock lays bare two awkward facts about the war in Afghanistan.

The first is that Pakistan is crucial to the success of the Obama administration's strategy in Afghanistan.

The second is that America's medium-term desire to reduce its financial and troop commitments is butting up against Pakistan's long-term and very different objectives for the shape of the region and Pakistan's role in it.

Pakistani military is very angry at US

Christine Fair, who has advised the Obama administration on its Pakistan policy and is an assistant professor at Georgetown University, summarizes the situation by saying that both sides are furious at each other, but neither is in a position to break from the other.

She says that Pakistan's military is attempting to inflict "an optimal level of pain" right now to make its displeasure known over the cross-border helicopter attack, but won't keep the border closed indefinitely.

"The Pakistani military is very angry right now.… They want to remind the Americans that they have us where they want us," Professor Fair says. "Pakistan is the only logistical option for [transporting] the supplies."

But in turn, the closing of the border is costing local interests – from what she terms the "trucking mafia" to the Taliban commanders who are widely believed to take a cut of the protection money paid to deliver NATO supplies on both sides of the border – a lot of money. Pakistan has left the other main border crossing, at Chaman, farther south, open.

And Pakistan won't be served by its expression of anger for long, she argues.

Ultimately, Pakistan – particularly now that it's trying to recover from devastating floods – understands that it needs the US for economic support far more than the US needs Pakistan. That's a strong pressure for a reversion to the status quo.

"It's been this way for the longest time: They help us, they work against us – whether it's ground troops or [Pakistani intelligence]," says Marvin Weinbaum, who was a Pakistan and Afghanistan analyst at the US State Department until 2003 and is now a scholar at the Middle East Institute in Washington.

"I don't think it's possible to make a general statement here," Mr. Weinbaum says. "There's evidence of Pakistan both facilitating our operations and facilitating the insurgents."

Where Pakistan's bloody past figures in

In the 1980s, Pakistan's military government and the powerful Inter-Services Intelligence service, with US assistance, nurtured the mujahideen resistance to the Soviet occupation of Afghanistan (1979-89).

After the Soviets were driven out of the country, the US turned its focus away from the region. Pakistan, with a strong Islamist identity, and worried that India – the state it so bloodily separated from in 1947 – was a threat to its independence and ambitions, turned to the mostly ethnic-Pashtun Taliban, supporting the group in its takeover of the country as a reliable proxy and enemy of India.

Since 9/11, despite improved ties with the US and massive aid inflows to the country (Pakistan will receive about $2 billion from America this year alone), little appears to have occurred to convince Pakistan that the Taliban – either in the home-grown or Afghan version – are a greater threat to its interests than India.

Pakistan's dispute with India over Kashmir continues to simmer. And elements of Pakistan's intelligence services appeared to provide aid to both an attack on India's embassy in Kabul and to the militants who murdered more than 160 people in Mumbai (Bombay), both in 2008.

What happens if the Taliban lose?

Analysts say Pakistan's generals fear a conclusive Taliban defeat will lead to a reduction in US interest and aid, and so have supported the group's three main Afghan factions – the Quetta Shura, the Haqqani network, and the forces of Gulbuddin Hekmatyar – to give themselves leverage in deciding Afghanistan's future.

"The legacy of the Soviet era is still being lived by Pakistan," says retired Gen. Talat Masood, now a security analyst. "America has abandoned Pakistan [before] – they may leave behind a Pakistan that is unstable."

He says the Pakistani military establishment provides sanctuary to pro-Pakistan militant groups to give itself leverage in any postpullout scenario and as a hedge against a repetition of what they see as America's abandonment of the region after the Soviet withdrawal.

"So that's why it's very important for America not to push Pakistan to a position where [Pakistan has] to antagonize every segment of the Pashtuns, including the Haqqani group, which may turn inward, toward Pakistan."

That last portion of his comment holds out some hope that US and Pakistani interests may become more closely aligned – someday. In a sense, Masood says, Pakistan wants to bring the Taliban in its midst to heel – but just not yet.

"Ultimately, Pakistan will have to establish its own writ, but it's a question of when it's more appropriate," he says, with an eye toward Afghanistan. Long term, he points out, "it is unacceptable that militants occupy your territory."