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.
@highlight
Pakistan acted as U.S. spearhead against Soviet Union when it invaded Afghanistan
@highlight
Fawaz Gerges says the U.S. lost interest, leaving Pakistan to pick up pieces in Afghanistan
@highlight
He says Pakistan relied on Afghan Taliban to impose order on Afghanistan
@highlight
He says Pakistan sees its interest tied to Taliban and need to counter influence of India
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 @placeholder, because the former began to threaten the current Pakistani government.