The news from Pakistan is grim. NATO helicopters engage suspected militants inside Pakistan, killing three, only to discover they are Pakistani soldiers. The angry Pakistani government blocks NATO fuel shipments at the Khyber Pass, and militants attack the stalled trucks. An Obama administration report to Congress charges that the Pakistanis aren't doing enough against the Taliban and al Qaeda. Press accounts quote unnamed officials asserting that elements in Pakistani intelligence are encouraging the Taliban to step up attacks on NATO forces. And Bob Woodward cites President Obama as saying "the cancer is in Pakistan."
One could easily conclude that we are describing an enemy, not an ally. Many in Pakistan feel the same way. And yet the prospects for stabilizing Afghanistan, defeating al Qaeda and preventing further attacks on the United States are a direct function of that strained alliance. It is time for a collective deep breath.
Then came 9/11 and the U.S. was back. Pakistanis welcomed the renewed assistance. But a constant question I heard while serving as ambassador to Pakistan from 2004-2007 was "How long will you stay this time, and what mess will you leave us with when you go?" For a fragile state with innumerable problems, including a vicious internal insurgency, these are existential questions.
Never in Pakistan's six decades of existence has the U.S. sustained a long-term, strategic commitment in the country. The Bush administration recognized this and enacted security and economic assistance programs designed to make a long-term difference in education, health care and governance. In 2006, I argued successfully for a five-year assistance package for Pakistan's Federally Administered Tribal Areas (FATA), which are notable both for chronic underdevelopment and extremism. The Obama administration has built on this, and last year's Kerry-Lugar bill provided $7.5 billion in assistance over five years. So we have the architecture in place to build a strategic relationship.
Still, short-term pressures risk undermining long-term strategy. When I was ambassador, voices in Congress, the media and even the administration were constantly calling for the U.S. to get tough on Pakistan, make Pakistanis do more, threaten them with consequences. Such exhortations were—and remain—generally counterproductive, as they fuel fears that the U.S. will again abandon Pakistan.
The U.S. can better work with Pakistan if we improve our understanding of history: Given its rivalry with India and its organic disunity, which dates back to its founding, Pakistan fears for its basic survival. The country has always had a difficult relationship with Afghanistan, not least because in the 19th century the British deliberately drew the Pakistani-Afghan border, the so-called Durand Line, in order to divide the Pashtun people. Today Pashtuns make up Afghanistan's largest community, but there are more Pashtuns in Pakistan.
The Durand Line also set the groundwork for the tribal areas, which are legally distinct from the rest of Pakistan because the British could never exert direct control over them. No central authority ever has. Winston Churchill's first published work, "The Story of the Malakand Field Force," is about fierce tribesmen declaring jihad against a Western army. It could be a contemporary account.
So what does this mean in concrete terms?
First, the U.S. should appreciate Pakistan's challenges and support its government in dealing with them. This summer's devastating floods have disappeared from the U.S. media but will continue to wreak havoc in Pakistan for a long time to come. In 2005 and 2006, after an earthquake in Kashmir killed almost 80,000 Pakistanis, the U.S. organized the largest relief operation since the Berlin Airlift. The floods' death toll is lower, but their long-term damage will be far greater. U.S. support should be commensurate.
Second, the U.S. should not carry out cross-border military actions, which I strongly resisted as ambassador. They are clearly counterproductive, and not just because we hit the wrong target. If NATO can carry out military actions in Pakistan from the west, Pakistanis wonder, what stops India from doing the same from the east? There are other options, including drone strikes, which the U.S. is now coordinating more closely with Pakistanis.
Third, with Pakistan's government (as with Afghanistan's), we must be private in our criticism and public in our support. Private talks should deepen regarding challenges like the insurgent Haqqani network in North Waziristan, and we need to listen at least as much as we lecture.
Fourth, any talks between the U.S. or Afghanistan and the Taliban must be transparent to the Pakistanis. A nightmare for Islamabad is the prospect that the Americans and Afghans come to some accommodation with Taliban elements that would leave them hostile to Pakistan. If Pakistan is not part of the process, we will be working at cross-purposes and only the Taliban will benefit.
Pakistan's arrest of Taliban leader Abdul Ghani Baradar—at a time when he had begun reconciliation talks with Afghan authorities—underscored the risks of leaving Islamabad out of the loop. Going forward, the timing and nature of talks with the Taliban should be set by Afghans, Pakistanis and Americans working together.
None of this will be easy, but it is essential. A sustained U.S.-Pakistani partnership after the Soviet withdrawal from Afghanistan could have produced a very different history than the one we wrestle with today. Writing a different future requires making long-term commitments—on both sides of the Durand Line.
Mr. Crocker, the dean of Texas A&M's George Bush School of Government and Public Service, was U.S. ambassador to Pakistan from 2004 to 2007 and U.S. ambassador to Iraq from 2007 to 2009.