Editor's note: Fawaz A. Gerges is a professor of Middle Eastern politics and international relations at the London School of Economics, London University. He is author of "The Far Enemy: Why Jihad Went Global."

London (CNN) -- On a recent visit to India, British Prime Minister David Cameron had this to say about Pakistan, historically a close friend of the West's: "We cannot tolerate in any sense the idea that this country is allowed to look both ways and is able, in any way, to promote the export of terror, whether to India or whether to Afghanistan or anywhere else in the world."

Seen by the Pakistani government as a slap in the face, Cameron's remarks almost caused a diplomatic breach in relations between the two countries. His remarks followed the leaking of U.S. documents on the WikiLeaks website in which Pakistan's Inter-Services Intelligence agency was accused of secretly aiding and inflaming the Taliban insurgency in Afghanistan, and they engendered a heated debate in Western capitals on whether Pakistan is a friend or a foe.

The dominant narrative in the West now is that Pakistan is a foe, playing a double game, guiding the Afghan insurgency with a hidden hand even as it receives more than $1 billion a year from Washington for its help in combating al Qaeda and like-minded groups.

"The burden of proof is on the government of Pakistan and the ISI to show they don't have ongoing contacts" with the militants, said U.S. Sen. Jack Reed, a Democrat on the powerful Armed Services Committee who visited Pakistan this month.

During a July visit to Pakistan, Secretary of State Hillary Clinton publicly aired Washington's suspicion and mistrust of its ally by stating that she believed that someone in the Pakistan government knew where al Qaeda chief Osama bin Laden was hiding in the country's tribal regions along the border with Afghanistan.

Clinton's statement was an implicit indictment of Pakistan's double game; it was met with angry denials by Pakistani leaders, who said the U.S. undervalued their support and sacrifice in battling al Qaeda.

What this simplistic argument neglects is that Pakistan serves its own vital national interests and cooperates with the West only to advance those interests.

An underlying premise in inter-state relations is that nations have only interests and no permanent friends. That is the game nations have played since the establishment of the state system in the Peace of Westphalia in 1648. Pakistan's foreign policy is a case in point.

Throughout the Cold War rivalry between the U.S.-led Western alliance and the Soviet camp, Pakistan allied itself with the West and fought devastating wars against India, its strategic rival and a close friend of communist Russia. The Pakistan leadership leveraged the Cold War to extract military and technical aid from the United States and the Western powers.

When Soviet troops invaded Afghanistan, Pakistan acted as America's spearhead in the fight against the "evil empire," and its Inter-Services Intelligence agency was in charge of the CIA's expansive campaign to train, arm and guide the Afghan mujahedeen, including the bin Laden contingent of the Afghan Arabs.

More than any other power, Pakistan played a key role in the armed resistance that turned Afghanistan into Russia's Vietnam. In return, Pakistan's security forces received logistical and financial aid from the U.S., but more important, Pakistan gained the upper hand in Afghanistan, becoming a paramount arbiter of its neighbor's internal affairs.

After the Soviet forces retreated in defeat in 1989 and Afghanistan plunged into all-out civil war, Pakistani leaders felt deserted by the U.S. and had to pick up the shattered pieces and bring about a measure of stability to the war-torn country. Once the Soviet Union collapsed, the U.S. had no interest in either Afghanistan or Pakistan, relics of the Cold War.

Pakistan relied on the Taliban, a student-led Islamic-based social movement that burst into the scene and imposed a draconian order wrapped in an Islamic emirate in Afghanistan in the 1990s. Pakistan's Inter-Services Intelligence agency nourished a close connection with the Taliban and consolidated its hegemony over the broken country.

Although Pakistan was a close friend of the U.S.'s from the 1950s until 1989, the 1990s marked the beginning of suspicion and distrust between the two countries. The Pakistani leadership, particularly the security apparatus, felt scorned and abandoned by its former superpower patron, which cut Pakistan off from military aid because of its nuclear weapons program and threatened to impose sanctions on it.

There is more to the relationship between Pakistan and the West than the simple dichotomy of "either/or."

For example, since last year, U.S. officials say the Pakistani military has launched a powerful offensive against the Pakistan Taliban, who are allied with the Afghan Taliban, because the former began to threaten the current Pakistani government. (The Pakistani military has suffered more than 2,000 casualties, and hundreds of thousands of ordinary citizens have been displaced.)

The Pakistani military insists that it is waging all-out war against both al Qaeda and its extremist allies -- the Pakistan Taliban -- and U.S. officials concur that they have seen a shift in the country's attitudes toward the Taliban in the past 18 months.

On the other hand, the Pakistan military appears to be reluctant to attack the Afghan Taliban, as the West demands, because it wants to leverage the Taliban in any future settlement in Afghanistan. For the Pakistani leadership, the Afghan Taliban are an important bargaining card, a strategic reserve on which they could rely when Western troops exit the war-torn country.

Like their Western nemesis, the Afghan Taliban bitterly complain that the Pakistanis are playing a "double game" with them and say that they "feed us with one hand and arrest and kill us with the other." There is no love lost between Pakistan and the Taliban, a relationship based on self-interests and political considerations.

Pakistan's strategic rivalry with India outweighs any pressure exerted by the West on Islamabad to end support for the Afghan Taliban. Pakistan's conduct via Afghanistan is driven by geostrategic concerns and fear of Indian influence in its backyard, not by intrinsic hostility or friendship toward the West or the Afghan Taliban.

If the Western powers want to drive a wedge between Pakistan and the Afghan Taliban, they must address Pakistan's geostrategic concerns and interests via India. An effective settlement of the Afghan-Pakistan conflict must be region-wide and involve India, Pakistan, Afghanistan, Iran and China, an almost impossible mission.

The opinions expressed in this commentary are solely those of Fawaz A. Gerges.