“I’d like to think that we are at that point and that we can indeed do that,” he said. “Certainly this relationship is in a difficult stage. But however difficult the relationship may be, it is one that we need to continue to work. It is one where we need to recognize what our Pakistani partners have done,” sacrificing several thousands soldiers and police officers in their own counterinsurgency efforts.

Speaking at the Forum for New Diplomacy in Paris at an event cohosted by the International Herald Tribune, Mr. Petraeus called the Afghan Army and police forces “increasingly credible.” He also described how they were steadily taking more responsibility from NATO allies as a gradual withdrawal of tens of thousands of U.S. troops looms.

Afghan forces participate in all counterterrorism night raids and take the lead in 20 percent of them, he said, and there are now 43 validated Afghan police districts across the country, counting some 6,938 members among their ranks. The number of insurgent attacks has spiked less than expected during the current fighting season, declining in eight of the last 12 weeks compared to the same period in past years, while allies have made some important territorial gains, he said.

But the general stressed that “those gains remain fragile and they remain reversible.”

“We are there to ensure that that country does not once again become a sanctuary to Al Qaeda or other terrorists,” he said. “The only way to achieve that is to ensure that the Afghans secure themselves and govern themselves.”

It has been a long and slow process, he admitted, and one that is far from accomplished. Out of 160 Afghan battalions, only one is considered truly independent in terms of its capability; the majority still depend on U.S. advice or active assistance. Some 2,303 former insurgents have been reintegrated into local communities — a “great success,” Mr. Petraeus said, though he acknowledged that in a country with as many as 35,000 insurgents the national impact of that program had not yet been felt.