If you've been following the news lately, you probably know that the relationship between Pakistan and the United States has been going through a rough patch.

Pakistani officials accuse the Americans of rampant and unauthorized spying, as dramatized in the case of the CIA contractor Raymond Davis, who shot two Pakistanis in the city of Lahore earlier this year. Protesters denounce drone attacks that kill innocent civilians as well as terrorists.

The Americans blame the Pakistani government for complicity in the murder of the journalist Saleem Shahzad and wonder how Osama bin Laden managed to escape justice for so long even though he was living in a town filled with Pakistani soldiers.

The anger on both sides has now gone beyond words. Pakistani politicians are making highly publicized trips to China, Iran, and Saudi Arabia, countries portrayed as more dependable friends than the U.S. Pakistani generals have pulled their troops back from the Afghanistan border, thus making life harder for the U.S. (and Afghan) forces on the other side. Washington, for its part, has suspended $800 million in aid to the Pakistani military.

It's no wonder that some people have started suggesting that the relationship between the two countries is now on the verge of complete collapse.

And yet all the hysteria tends to neglect some important points. First of all, it's worth remembering that the relationship between Pakistan and the United States has never been based on affection. What has always brought the two countries together is a clear set of common interests.

During the Cold War they were on the same side against the Soviet Union and its main regional ally, India. After the Soviet invasion of Afghanistan they collaborated in supporting the jihad against the Red Army.

'Inseparable'

There have always been tensions along the way as these interests have evolved. Over the past five decades, there have been plenty of ups and downs in the relationship. In the early 1990s, for example, the U.S. disengaged from Afghanistan, declaring its aims achieved with the Soviet defeat. Pakistan was left to cope with the ensuing civil war and the devastating effects that had on its own domestic stability.

When George W. Bush declared after the September 11, 2001 attacks that "you're either with us or against us," Pakistan's political establishment threw in its lot with the United States once again -- even though the relationship has been periodically plagued by mutual suspicion and distrust ever since.

Yet it has never broken down completely. "They get very angry at each other, but they are inseparable," says Pakistani analyst Salim Safi. That, he says, is because the relationship between the two countries is based on shared interests. The United States needs Pakistan's support in winning the almost decade-long war against the Taliban, while Pakistan needs U.S. military and financial assistance to support its dwindling economy and equip the army against its much larger and powerful rival, India.

The headlines have been full of stories about the disagreements between the U.S. and Pakistan. Yet just days after Washington announced it was cutting aid, General Ahmad Shuja Pasha, director of the Inter-Services Intelligence Directorate (ISI), arrived in Washington for talks with senior U.S. officials. Meanwhile U.S. CENTCOM chief General James N. Mattis was visiting Islamabad.

The relationship might be tense, but the two sides certainly haven't stopped talking to each other.

The primary question now is whether the interests that once drew the two countries together are now driving them apart. “The United States and Pakistan can't go together side by side for a longer time because they are pursuing divergent interests,” says ex-ISI chief Lt. General Asad Durrani, who was at the helm of affairs during the Afghan jihad.

Both General Durrani and Safi, the analyst, say that the real problem right now is that Pakistan's key interests are increasingly focused on its conflict with India and the Baluchistan separatist movement. The United States has been seeking closer cooperation with India in recent years, which makes Islamabad uneasy. Many of the Baluchi separatists are now based in neighboring Afghanistan, where coalition forces have shown little interest in confronting them -- something that also contributes to Pakistan's ire.

Officials in Washington, meanwhile, cannot understand how Pakistan's government can go on trying to distinguish between "good" jihadis (fighting against the Indian presence in Kashmir) and "bad" ones (who want to topple the government in Islamabad). The Pentagon, the White House, and the State Department are clearly less inclined than ever to keep showering money on the Pakistanis while they try to figure it out.

If things keep going this way, the result could be catastrophic.

But there is a way out. It is time for the two countries to sit down at the table and take a good, candid look at their relationship. This can help push the two to institutionalize and establish a relationship based on trust instead of interest.

Possible Scenarios

Pakistan and the United States should talk about how the U.S. can help to find a solution to the Kashmir dispute. Only then can Pakistan eradicate its fear of being attacked by India. And that, in turn, would allow Islamabad to break its ties with the jihadis.

Afghanistan has now become a theater of the strategic competition between Pakistan and India. India has invested $1.5 billion in the Afghan economy, while Pakistan struggles to keep it out. Both Delhi and Islamabad see Afghanistan as a bridgehead of influence in Central Asia and beyond. A solution to the dispute in Kashmir that would allow the two countries to open up their borders and put years of enmity behind them would thus benefit stability in Afghanistan as well.

The simple fact is that divorce is not an option. Pakistan desperately needs economic and military assistance to fight its homegrown insurgency. Meanwhile, the United States is rushing for the exits in Afghanistan, which means that Washington will be more dependent than ever on Pakistan to maintain stability in the country.

Although Pakistan knows its weaknesses, it is also fully aware of its strategic importance and knows that the United States needs its cooperation and support at this critical juncture.

There are two possible scenarios at this point. In the first, the United States simply withdraws from Afghanistan without providing for a stable government. In that case, the region will witness more violence and instability as the regional players -- Pakistan, Indian, Iran, China, Russia and Saudi Arabia -- struggle for influence.

In the second, the U.S. and Pakistan devise a new relationship based on cooperation and trust. Washington helps Pakistan and India to arrive at a workable solution to their long-running conflict. A Pakistani government that no longer feels threatened by Delhi would be in a position to stop using Afghanistan as a possible hedge ("strategic depth") in the event of war with India.

Within Pakistan there is a profound longing for the end of hostility toward India among people in all walks of life, and this desire is growing all the time. If Washington were to seize the chance to mediate a genuine and lasting piece in South Asia, Pakistanis would undoubtedly have a very different attitude toward America's role in the region.

Now that would be a relationship with staying power.

Daud Khattak is a correspondent with RFE/RL's Radio Mashaal. The views expressed in this commentary are the author's own and do not necessarily reflect those of RFE/RL