The Afghan authorities say that they have foiled a major attack on the Kabul that was being planned by the Pakistani-based Haqqani network. Raiding a property in the capital yesterday they discovered a large stock of arms and ammunition together with five suicide vests. One of the seven suspected terrorists was killed in a firefight as the security forces moved in. The weapons cache and the six arrested men were put on display for the international media.

This has been a welcome success for the Afghan forces in interdicting attacks. Sources have suggested that although intelligence had picked up the fact that another Taleban “spectacular” was imminent in Kabul, it was a tip-off from a suspicious local that led investigators to the insurgents’ hideout and their weapons store. Security around the city is tight and it seems clear that the Taleban are finding it more difficult to organize and mount their high profile attacks. Nevertheless the mood of optimism that once gripped the capital has all but disappeared among ordinary people weary of the violence and longing only for peace.

Afghanistan’s President Hamid Karzai is hardly less weary. Indeed he said last week that he was “exhausted” and was looking forward to the end of his second and final term of office after elections next April. He vigorously denied rumors that he intended to try and cling on to power, saying that such a move would be neither good for him personally nor for Afghanistan. Indeed he went on to say that he was concerned for his own safety and that of his family once he stepped down from office, indicating that he was probably thinking of leaving the country after handing over to his successor.

This statement perhaps indicates better than anything the political and security inheritance Karzai is leaving behind him. By next year as Afghans go, probably without much enthusiasm, to the polls to choose their new president, the NATO forces will be busy disengaging from a war that in effect, was lost before they even began to deploy. The failure to include the Taleban in the Bonn talks that followed their ouster in 2001, guaranteed that once they had recovered from their defeat and reorganized their forces, they and their Al-Qaeda allies would come back fighting.

This was the pivotal moment when the Taleban leadership, or at least a significant portion of it could have been separated from Bin Laden’s fanatical and amoral organization. However, such was the triumphalism of President George W. Bush and the lack of wise counsel from the US State Department, that the Bonn conference allowed itself to be fooled into believing that the Talebs were gone and gone for good. Everything about the past experience of foreign armies in Afghanistan, from the British to the Russians, should have indicated that this was by no means the end of the matter as far as the Taleban were concerned.

It is easy to underestimate the impact that NATO forces have had in training up the Afghan police and army. There are it is true, still big questions over the abilities of the police, who must live in the sometimes hostile communities where they are supposed to be enforcing law and order. Less dubious is the army. Despite “blue on blue” attacks where Afghan soldiers, infiltrated into the forces by the Taleban or responding to threats to their families, have attacked NATO troops alongside whom they fought, the country’s soldiers have performed well.

Now well-equipped and trained, they have proved themselves able to confront, defeat and deter the Taleban. Once NATO pulls out its fighting forces, there will still be trainers and liaison officers and Afghan commanders will still have access to all-important intelligence supplied, it must be supposed, from Washington. Indeed it may also be that, once most US troops and aircraft have quit the country, there will be a marked increase in the use of drones, both to gather intelligence on Taleban movements and activities and also, more controversially to attack and destroy insurgent formations.

However, committed soldiers will be no good without committed commanders and here is where the big question lies. With the retirement of President Karzai, his sometimes startlingly corrupt and ineffective regime will be dismantled in fresh allocations of power and patronage under the new president. To keep the Taleban at bay and pursue the negotiations that are the only sure route to peace, the new administration must protect and nurture its security forces and not use them as a political pawn for internal rivalries.