ISLAMABAD, Pakistan — Nobody else in the Obama administration has been mired in Pakistan for as long as Defense Secretary Robert M. Gates. So on a trip here this past week to try to soothe the country’s growing rancor toward the United States, he served as a punching bag tested over a quarter-century.
“Are you with us or against us?” a senior military officer demanded of Mr. Gates at Pakistan’s National Defense University, according to a Pentagon official who recounted the remark made during a closed-door session after Mr. Gates gave a speech at the school on Friday. Mr. Gates, who could hardly miss that the officer was mimicking former President George W. Bush’s warning to nations harboring militants, simply replied, “Of course we’re with you.”
That was the essence of Mr. Gates’s message over two days to the Pakistanis, who are angry about the Central Intelligence Agency’s surge in missile strikes from drone aircraft on militants in Pakistan’s tribal areas, among other grievances, and showed no signs of feeling any love.
The trip, Mr. Gates’s first to Pakistan in three years, proved that dysfunctional relationships span multiple administrations and that the history of American foreign policy is full of unintended consequences.
As the No. 2 official at the C.I.A. in the 1980s, Mr. Gates helped channel Reagan-era covert aid and weapons through Pakistan’s spy agency to the American allies at the time: Islamic fundamentalists fighting the Russians in Afghanistan. Many of those fundamentalists regrouped as the Taliban, who gave sanctuary to Al Qaeda before the Sept. 11, 2001, attacks and now threaten Pakistan.
In meetings on Thursday, Pakistani leaders repeatedly asked Mr. Gates to give them their own armed drones to go after the militants, not just a dozen smaller, unarmed ones that Mr. Gates announced as gifts meant to placate Pakistan and induce its cooperation.
Pakistani journalists asked Mr. Gates if the United States had plans to take over Pakistan’s nuclear weapons (Mr. Gates said no) and whether the United States would expand the drone strikes farther south into Baluchistan, as is under discussion. Mr. Gates did not answer.
At the same time, the Pakistani Army’s chief spokesman told American reporters at the army headquarters in Rawalpindi on Thursday that the military had no immediate plans to launch an offensive against extremists in the tribal region of North Waziristan, as American officials have repeatedly urged.
And the spokesman, Maj. Gen Athar Abbas, rejected Mr. Gates’s assertion that Al Qaeda had links to militant groups on Pakistan’s border. Asked why the United States would have such a view, the spokesman, General Abbas, curtly replied, “Ask the United States.”
General Abbas’s comments, made only hours after Mr. Gates arrived in Islamabad, were an affront to an American ally that gave Pakistan $3 billion in military aid last year. But American officials, trying to put a positive face on the general’s remarks and laying out what they described as military reality, said that the Pakistani Army was stretched thin from offensives against militants in the Swat Valley and South Waziristan and probably did not have the troops.
“They don’t have the ability to go into North Waziristan at the moment,” an American military official in Pakistan told reporters. “Now, they may be able to generate the ability. They could certainly accept risk in certain places and relocate some of their forces, but obviously that then creates a potential hole elsewhere that could suffer from Taliban re-encroachment.”
Mr. Gates’s advisers cast him as a good cop on a mission to encourage the Pakistanis rather than berate them. And he was characteristically low-key during most his visit here, including during a session with Pakistani journalists on Friday morning at the home of the American ambassador to Pakistan, Anne W. Patterson.
But Mr. Gates perked up when he was brought some coffee , and he soon began to push back against General Abbas. American officials say that the real reason Pakistanis distinguish between the groups is that they are reluctant to go after those that they see as a future proxy against Indian interests in Afghanistan when the Americans leave. India is Pakistan’s archrival in the region.
“Dividing these individual extremist groups into individual pockets if you will is in my view a mistaken way to look at the challenge we all face,” Mr. Gates said, then ticked off the collection on the border.
“Al Qaeda, the Taliban in Afghanistan, Tariki Taliban in Pakistan, Lashkar-e-Taiba, the Haqqani network — this is a syndicate of terrorists that work together,” he said. “And when one succeeds they all benefit, and they share ideas, they share planning. They don’t operationally coordinate their activities, as best I can tell. But they are in very close contact. They take inspiration from one another, they take ideas from one another.”
Mr. Gates, who repeatedly told the Pakistanis that he regretted their country’s “trust deficit” with the United States and that Americans had made a grave mistake in abandoning Pakistan after the Russians left Afghanistan, promised the military officers that the United States would do better.
His final message delivered, he relaxed on the 14-hour trip home by watching “Seven Days in May,” the cold war-era film about an attempted military coup in the United States.