FOREIGNERS have always struggled to exercise any sort of control over Afghanistan. And the war America and its allies embarked on there in 2001 has often seemed as endless and unwinnable as so many previous invasions. But the past few days have seen the American administration attempt to show that it can manage at least the narrative of the war. It wants to turn the story of a grim, inescapable quagmire into one of erratic but irreversible progress towards a resolution acceptable to all. It is a better story, but can it be a credible one?

Killing Osama bin Laden was a huge help. In a sense his death accomplished the primary mission that took America into Afghanistan. But he was killed in Pakistan and most of the 130,000 foreign troops in Afghanistan are not engaged in hunting down al-Qaeda remnants. They are there to stabilise Afghanistan. So when Barack Obama confirmed this week that America will begin drawing down its troops in July, he had to point to progress in Afghanistan itself as well as in killing leading terrorists.

His announcement fulfilled a promise made when he approved a “surge” of 30,000 additional troops in late 2009. Indeed, he said all the surge troops are to be back by September 2012. The plan is to leave the Afghan government responsible for its own security by 2014, through a beefed-up national army, supported by a much-diminished but still large foreign contingent.

Nobody expects that Afghanistan will be wholly at peace by then, nor that the Taliban insurgency will have been routed. So for the troops to leave with dignity there needs to be some semblance of a peace process. This week, America's defence secretary, Robert Gates, confirmed that America has been engaged in “very preliminary” talks with the Taliban. That requires some embellishment of the Taliban's image. That is tricky when they are the enemy. At America's urging, a United Nations sanctions committee has agreed to distinguish between the Taliban—a domestic political force as well as an armed insurgency—and al-Qaeda, perpetrator of global terrorism.

The obstacles in the way of reaching an accommodation with the Taliban are manifold. There is the oft-repeated cliché that “the Americans have the watches, but the Taliban have the time.” Setting a timetable for withdrawal gives the Taliban reason to think that they can wait out the latest foreign power to try to bend Afghanistan to its will. And of course at the same time as pursuing “outreach”, America is doing its high-tech damnedest to kill as many Taliban leaders as it can. In what one Western diplomat calls the Taliban's “madrassa, linear-thinking sort of way” this does not infuse talks with mutual trust.

Then there is the thorny question of which Taliban Mr Obama wants to reconcile. The insurgency is conventionally broken down into three main components: the “Quetta shura” of Mullah Omar, the leader of the former Taliban government, now holed up in Baluchistan in Pakistan; and two other forces, the Haqqani network and Hizb-e-Islami. But even this topology grossly oversimplifies. The Taliban, too diffuse even to be considered a “movement”, range from bloodthirsty bandits and drug-lords to pacific tribal elders, representing the conservative social mores of the Pushtun, Afghanistan's largest ethnic group.

Ethnic kinship and a determination to see friends in power in Kabul make it unlikely that Pakistan will ever turn fully against the Taliban outfits it has nurtured. And, so long as it enjoys safe havens across the border, the insurgency will never be wholly defeated. But so long as the government in Kabul has the military and financial resources to survive—and America remains committed to ensuring that it will—some Taliban supporters will surely conclude that they have more to gain from an accommodation with it than from the resumption of full-scale civil war.

However, that accommodation is not straightforward. The settlement reached in Bonn in 2001 after the toppling of the Taliban was a “victors' peace”, and needs changing. The president, Hamid Karzai, is a Pushtun. But his regime is widely seen, in the Pushtun-dominated south, as a corrupt interloper representing Persian-speaking Kabulis propped up by white foreigners. For their part, non-Pushtun northerners are hardly going to cheer a Taliban return. Last month Amrullah Saleh, a former spy chief who resigned last year in protest at the government's conciliatory approach to Pakistan and the Taliban, mustered more than 10,000 Afghans to join a rally in Kabul against “deal-making”. Nobody is taking to the streets to demand that Mr Karzai welcome the Taliban back.

Hamstrung by Hamid

Mr Karzai himself is among the biggest obstacles that stand between America and a dignified withdrawal. That his supporters scandalously rigged the 2009 election which prolonged his rule was bad enough. But now, despite owing his office to the West's intervention in 2001, he has become among the loudest critics of its role in Afghanistan. In a splenetic recent speech to a conference of young people in Kabul, he told them that foreigners had come to Afghanistan “to pursue their own goals”. “They use our country,” he complained, accusing them both of taking away “100 times more profit from the country than they give it,” and of behaving like a rich guest, who has “involved us in a picnic”.

Without naming Mr Karzai, the outgoing American ambassador, Karl Eikenberry, responded fiercely, saying in a speech that, hearing this sort of outburst, Americans “grow weary of our effort here”. They certainly do (see Lexington). But the risk for moderate Afghans is less that America cuts and runs, abandoning them to a bloody Taliban restoration, than that its criteria for what constitutes an acceptable settlement keep creeping lower. It has become a commonplace to acknowledge that a post-war Afghanistan will “not be Switzerland”. But below Switzerland lies a huge range of possible outcomes, most of them bleak.