Nato's decade-long military intervention in Afghanistan will soon be over, but western governments will continue their generosity to that benighted country by maintaining their lavish aid programmes for many years to come. That is the reassuring message that was meant to go out from Nato's just-concluded Chicago summit.

With the new French president determined to get his combat troops out by the end of 2012 and two-thirds of the American public in favour of an early withdrawal of theirs, President Obama wanted to suggest that he is listening. So the summit trumpeted the "transition" to Afghan forces while seeking a commitment from Nato members to go on paying the Afghans long after the alliance's own troops have gone.

At the back of many Nato officials' minds is the Soviet Union's Afghan experience. Propaganda about a Soviet humiliation is giving way to awareness that the Russians pulled out in good order and the government of Najibullah, whom they left in charge, survived for three more years. When it collapsed 20 years ago, it was not because of the insurgents' prowess but because Moscow stopped delivering cash, fuel, and weaponry. Nato wants to avoid a similar outcome.

But there are key differences, summed up in two words not much heard in Chicago: talks and ceasefire. The Soviet Union sought to negotiate its exit by persuading Pakistan and the United States to stop arming the insurgents. Najibullah followed the same path by offering to include rebel leaders and monarchists in his government. At the local level his generals negotiated several ceasefires with mujahideen commanders. It was not enough, as Pakistan's Inter-services Intelligence directorate (ISI) and the Reagan administration urged the rebels to resist Moscow's and Kabul's offers and keep on seeking victory.

Obama has not learned the lesson. Vague efforts at trying to talk to the Taliban were resisted by hawks within his administration and have not become real. Now Obama is afraid Mitt Romney will beat the macho drum about not "appeasing the enemy". Meanwhile, on the ground, instead of seeking ceasefires American generals are intensifying night raids and missile strikes on suspected Taliban hideouts in Helmand and Kandahar.

Nato's biggest mistake is to go on relying on a garrison strategy. Increasing numbers of Afghan troops will sit in bases and go out on patrols instead of US and British ones, but this is nothing more than "Nato with an Afghan face". Locals see these Afghan troops as occupiers just like the US and British. Less than 4% of the Afghan National Army are southern Pashtuns. Most are Tajiks and Uzbeks who speak a different language and don't know the area. But if you recruit more southerners in a hurry, you just feed the Taliban's latest tactic: join the Afghan army and police, get trained by the Americans and British, then shoot them in the camp or mess hall.

To strengthen the garrison strategy, the US recently signed a partnership agreement with Hamid Karzai. It did not specify how many US troops will remain after combat forces leave in 2014 since Karzai is unwilling to commit himself and Obama wants to blur the issue for electoral reasons. But the plan to keep US troops after 2014 remains on the table. This is a disaster. Whether dubbed trainers or advisers, they will still be armed and uniformed US soldiers.

The Taliban will never accept that. "A lasting occupation means lasting resistance," as they put it on the eve of the Chicago summit, in a statement which distanced themselves from al-Qaida and reaffirmed a willingness to negotiate. "American intelligence networks including the CIA state that members of al-Qaida have all left Afghanistan. So America's military presence is not for its own security but a long-term strategy for turning our country and the region into its colony," it said.

We need a change of course. The US must prepare for a total troop withdrawal, as the Russians did. Some say the Taliban can just sit and wait for 2014, but in the two years before then the ISI must be persuaded to threaten the Taliban leadership, whom they host in Pakistan, with loss of their sanctuaries if they do not negotiate. Another big difference from the 1990s is the emergence of a new player: the Pakistani Taliban. Compromise in Kabul is better for Pakistan than an outright Afghan Taliban victory which would embolden their counterparts south of the border to move against Islamabad.

Two conflicts are ravaging Afghanistan: a war between Afghans and a resistance struggle against a foreign invasion. Both need to be stopped, ideally through negotiations for a government of national unity and a devolution of power to the provinces. Without a strong push to end the Afghan civil war as the foreigners leave, this weekend's stuff about "transition" will change little for most Afghans. Fewer foreign troops will die and Afghanistan will revert to being an unreported war. This will not be ending Nato's intervention with dignity, but with cynicism.