The first serious talks between the Afghan government and the Taliban took place 10 days ago in Mecca under the auspices of King Abdullah of Saudi Arabia. During the discussions all sides agreed that the war in Afghanistan is going to be solved by dialogue and not by fighting. The Taliban leader, Mullah Omar, was not present but his representatives said he was no longer allied to al-Qa'ida.
The admission by a senior British Army commander, Mark Carleton-Smith, over the weekend that absolute military victory in Afghanistan is impossible has been overtaken by the talks in Mecca. "If the Taliban were prepared to sit on the other side of the table and talk about a political settlement, then that's precisely the sort of progress that concludes insurgencies like this," said Brigadier Carleton-Smith. "That shouldn't make people uncomfortable."
This sounds as if Britain's latest military venture in Afghanistan is going to end in a retreat with none of its ill-defined objectives achieved. In the US, an understanding of the real situation on the ground has been slower to come. John McCain and Barack Obama still speak as if a few more brigades of American soldiers sent to chase the Taliban around the mountains of southern Afghanistan would change the outcome of the war.
US policy in Iraq after the overthrow of Saddam Hussein has been constantly denigrated as a recipe for self-inflicted disaster. But President Bush's policy in Afghanistan in the wake of the fall of the Taliban was just as catastrophically misconceived. In both countries the administration's agenda was primarily geared to using military victory to make sure that the Republicans won elections at home.
The Taliban has always been notoriously dependent on Pakistan and on the Pakistani military's intelligence service (ISI). It was the ISI which openly propelled the Taliban into power in the 1990s and covertly gave its militants a safe haven after their retreat from Afghanistan in 2001, enabling them to regroup and counter-attack.
But at the very moment this was happening Mr Bush was lauding the Pakistani government of General Pervez Musharraf, which had fostered the Taliban, as America's great ally in its war on terror. The self-defeating absurdity of this policy has not struck home in the US as did the debacle in Iraq though it is obvious that so long as the Taliban have a vast mountainous hinterland in which to base themselves, they will never be defeated.
The presence of foreign troops was always more popular in Afghanistan than in Iraq. The Afghans have a deep loathing for their warlords. But no foreign occupation force, particularly if reliant on ill-directed air attacks and engaged in combat, stays popular for long. This is particularly true if the foreign troops do not, in fact, deliver security. Meanwhile their presence means that Taliban fighters can portray themselves as patriots battling for their country and their faith.
The overthrow of the Taliban in 2001 was never quite what it looked like. Soon after they had given up the fight, I drove from Kabul to Kandahar along one of the world's worst-built roads. The Taliban were adroitly changing sides or going home as local deals were hammered out.
Casualties on both sides were mercifully low. In the ancient town of Ghazni, an accord on the end to Taliban power was only delayed because of a disagreement on how many government cars they could retain. In a village outside Kandahar, I asked a local leader if he could gather some former Taliban for me to meet and in half-an-hour the village guest house was full of confident and dangerous-looking fighters. I thought it would not take much for them to make a comeback.
Yet they would not have been able to do so without the blunders of the White House and the Pentagon. By invading Iraq they convinced General Musharraf that it was safe to give support to the Taliban once again. There were enough foreign troops in Afghanistan to delegitimise the Afghan government but not enough to defeat its enemies. Chasing Taliban fighters around the hinterland year after year only led to the insurgency expanding. The talks in Saudi Arabia are a long way from negotiations but they are a sign that the present political logjam might be beginning to break.
Brigadier Carleton-Smith's forthright admission that there can be no outright military victory also shows realism. The best route for Britain and the US in Afghanistan is to have modest and attainable objectives combined with a recognition that, in its struggle for survival, the Afghan government must fight and win its own battles.