When Pakistan’s prime minister visited Kabul this month, he spoke grandly to the public of an enduring friendship between neighbors and his country’s commitment to help Afghans in the grinding war with the Taliban. 

But in private meetings, Yousaf Raza Gillani and the leaders of Pakistan’s military and intelligence service offered a startling proposal for cooperation: The Afghan government should distance itself from the United States and seek new allies, particularly China, according to current and former Afghan officials with knowledge of the meeting.

Gillani read to President Hamid Karzai from a paper outlining Pakistan’s view that the U.S. military strategy had no prospect for success, that its troops antagonized the region and that the Afghan government should avoid any agreement that allows long-term U.S. military bases in Afghanistan, according to the Afghans.

Because of the growing fiscal problems in the United States, Gillani argued, America was a power in decline, one without the ability to support Afghanistan and Pakistan in the future, and Afghans should look “for alternative allies,” a senior Afghan official said. 

“That was the first time that the whole Pakistani state, military and civilian, spoke to us with one voice. That is important,” the Afghan official said. “If a country comes and puts its conditions on the table, we have to take that seriously.”

Although Pakistan is a U.S. ally, top Pakistani officials have long been deeply disdainful of U.S. policy in the region, and have been hedging their bets in case U.S. efforts in Afghanistan fail. Pakistan’s overture to the Afghan government — if Afghan accounts are accurate — marks one of the clearest signals to date that Pakistan is moving away from its partnership with the United States. Some of the Afghan officials spoke on the condition of anonymity because of the sensitivity of the issue.

A spokesman for Gillani denied that the Pakistanis delivered any such message but would not discuss the content of the meeting. “Whatever you’re saying is not true,” Shabir Anwar said.

Pakistan’s Foreign Ministry released a statement Wednesday saying that “Pakistan recognizes the key role of the United States in promoting stability, peace and harmony in Afghanistan.”

Obama administration officials said their reading of the meeting differed sharply from that of the Afghan officials. “Although the Pakistanis did caution the Afghans not to become too dependent on the Americans,” one official said, “they were reaching out to the Karzai government in a way that suggested they thought the time was right to move toward some kind of political settlement.”

“The good news,” the official said, “is that I think that there’s some prospect that Afghanistan will become the common ground on which the U.S. and Pakistan” can solidify their relationship.

The meeting, details of which were first reported in Wednesday’s Wall Street Journal, has sparked considerable debate in recent days among various factions in the Afghan government. Some see Pakistan’s offer as a turning point in the relationship between the two countries and one that shows promise. Others distrust Pakistan’s motives and believe Afghanistan cannot afford to abandon the United States in favor of partnerships with China, Pakistan and Saudi Arabia. 

Karzai’s chief of staff, Abdul Karim Khuram, called the meeting “historic” but would not go into the details about the discussions.

“Now we know what Pakistan wants,” he said in an interview.  

The meeting came a few days before U.S. Adm. Mike Mullen, chairman of the Joint Chiefs of Staff, spoke bluntly about alleged support within Pakistan’s main spy agency, Inter-Services Intelligence, for the Haqqani network, a Taliban-allied insurgent group that fights in eastern Afghanistan. “It’s fairly well known that the ISI has a long-standing relationship with the Haqqani network,” Mullen told Pakistani reporters. 

The comments have prompted another in a series of tense moments between Pakistan and the United States. The relationship, already reeling from the recent controversy over the shootings by CIA contractor Raymond Davis of two Pakistanis, appears to have reached its lowest point in years.  

Several prominent Afghans with knowledge of the workings of Karzai’s office confirmed the basic outline of the message from the Pakistani delegation, which included its army chief, Gen. Ashfaq Kayani, and the ISI’s director, Gen. Ahmad Shuja Pasha.

The Afghans said the Pakistani officials argued that there will be no peace without Pakistani involvement, and that as American troops begin withdrawing this summer, the U.S. commitment to the region will flag. Gillani described the United States’ strategy in Afghanistan as contradictory: On one hand, promoting a military, civilian and diplomatic “surge”; on the other, saying it is interested in a political settlement with the Taliban.

According to one Afghan political insider, the Pakistani delegation “showed dissatisfaction with the American relationship; that was the tone.”  

At a gathering in Kabul of Afghan political and business leaders Sunday evening, the Pakistani proposal was hotly debated. 

“This is outrageous behavior,” said a participant who is close to Karzai. “First we abandon the United States, then [Pakistan] will come and take us over? Very nice. It’s a good plot. I think after this, the president will come back the other way. Now it’s obvious that the only friend we have is the United States.”

A former Afghan official, an opponent of Karzai’s, was equally disturbed by the Pakistani visit. At this stage in the war, he said, “if you don’t hurt Pakistan, you lose.”

Staff writer Karen DeYoung in Washington contributed to this report.