AT FIRST glance, it looked like good news for Afghans who are increasingly nervous about what will happen when the American-led coalition of international forces ends its combat mission in December. On May 27th, a couple of days after he made a surprise visit to Bagram airfield north of Kabul (his first for two years), Barack Obama made a long-awaited announcement about the size of the American force that will stay on to train and assist Afghan security forces and conduct counter-terrorism operations against “the remnants of al-Qaeda”.

Mr Obama said that the residual force would number 9,800—down from 33,000 currently and 100,000 in 2011. The figure is close to what had been suggested by General Joseph Dunford, America’s senior commander in Afghanistan, and a long way above the so-called “zero option” favoured by some White House aides. A further 2,000-3,000 troops are likely to be provided by NATO allies, principally Germany and Italy.

The timing of the announcement was prompted in part by the second round of Afghanistan’s presidential election, which will be held on June 14th. Hamid Karzai, the outgoing president, has, to the frustration of American military planners and most Afghans, refused to sign the bilateral security agreement needed to provide a legal basis for the troops to stay. However, both of the remaining candidates to succeed him, Abdullah Abdullah, the favourite, and Ashraf Ghani, have promised to sign as soon as possible. They recognise that without continued American help with air support, logistics, communications and intelligence, Afghan forces, which number about 380,000, risk suffering a morale-sapping level of casualties in their struggle against a Taliban insurgency that shows no sign of flagging.

But Mr Obama also has an eye on how things will play at home. Despite being urged by his generals to apply “conditions-based” criteria to how long the residual force should be deployed in Afghanistan, Mr Obama announced a strict timetable that appears to owe everything to the cycle of American politics and nothing to realities on the ground. Half of the remaining troops will be withdrawn by the end of 2015; and by the end of 2016, as Mr Obama prepares to leave office, nearly all of those left will depart. A tiny contingent will stay on to provide protection for the American embassy and help with military sales. Mr Obama, it seems, has decided that “to turn the page” on Afghanistan, as he put it this week, is more important for his political legacy than doing the minimum that might be required to prevent the failure of a long and costly mission.

John McCain and Lindsey Graham, two perennially hawkish Republican senators, promptly criticised the plan and its “arbitrary date” as “a monumental mistake and triumph of politics over strategy” that risked a similar disastrous outcome to the premature withdrawal of troops from Iraq. But even allies of the president, such as Michèle Flournoy, a former Pentagon policy chief who now heads the Centre for a New American Security, a think-tank, are concerned about the pace and inflexibility of the timetable. David Sedney, a recent deputy assistant secretary of defence for Afghanistan and Pakistan, described the decision as giving with one hand and taking away with the other. As for the reaction of Afghan army officers, reports suggest they are bleakly pessimistic. They know that the big gaps in their capabilities, especially a chronic lack of air power, cannot be bridged in the time allowed. Mr Obama promised this week that he would bring the war to “a responsible end”. Many Afghans see it differently.