During his two-day trip across Iraq and Afghanistan, Gordon Brown signalled the end of one of the wars bequeathed to him by Tony Blair, and more involvement in another.
Britain is handing over the running of Basra, the last province it controls in southern Iraq, allowing UK forces in Iraq to be cut to fewer than 2,000 by next spring. But Brown has promised more support, economic and military, for Afghanistan, praising President Karzai's government for its stand against insurgents "who threaten not only your country but who are dangerous for the whole world".
Behind the rhetoric of propping up Karzai's government with a big increase in money and technical support, there is a more pragmatic mood around Afghan policy in Brown's government, and an increasing awareness that change will be slow and gradual, and that the attempt may fail.
This is a radical shift in policy from the triumphalism of 2001 that imposed democratic structures as if from outer space.
In order to succeed in this new Great Game, British diplomats are relearning the skills of political officers on the frontier in Victorian times - co-operating with the conservative grain of the country, attempting to understand and work with traditional rural structures, negotiating with elders and ultimately with the Taliban.
The EU representative in Kabul, Francesc Vendrell, has admitted that trying to understand realities on the ground here is new. "People knew there were various tribes within the Pashtun. But because there was a feeling that things were still going to become normal, it was not thought necessary for us to understand the tribal system."
The policy change has parallels with the decision taken by another new leader of a country stuck in the Afghan quagmire six years after an invasion. In 1985, Mikhail Gorbachev told a Politburo meeting: "You'll have to revive Islam, respect traditions, and show the people some tangible benefits from the revolution."
For "revolution" read "democracy", and the sentence could have come from Brown's statement. The situations faced by the two leaders have uncanny parallels. As the fighting on the ground intensified, the views of the families of those serving in the military began to have political impact in Russia, as in Britain now. Gorbachev tried to use this to his advantage, reading out the letters from mothers of Russian soldiers to justify his change of policy.
In 1985, as in 2007, the long conflict led to urgent questions about the capacity of the Kabul government to deliver a result, with the mental state of the president - Babrak Karmal then, Karzai now - openly discussed by diplomats and local politicians. The rumours, then as now, spoke of the president's long, rambling discourses and his closeness to a corrupt elite, including members of his own family.
There are important differences. Soviet military intervention killed hundreds of thousands and displaced millions, and it would be grotesque to compare the Taliban with the mujahedin, who had significant popular support for their fight against the Russians. The Taliban, beyond a small bedrock of core supporters, were still hated by most and feared at best.
Brown's policy shift is an acceptance that neither the central nor provincial government has much meaning. There is a realisation that democratic accountability does not exist in any practical terms across most of the country. The national police force is a cancerous growth, openly corrupt - a recruiting sergeant for the Taliban. No one is going to announce that democracy has been abandoned, but it has become as hollow an idea here as communism had by 1985.
Instead, in the words of Britain's ambassador, Sir Sherard Cowper-Coles, the key is to "understand the human terrain of this country". Bearded British diplomats are going out on the ground, like the political officers of the Great Game years in the 19th century, doing deals sitting cross-legged around plates of rice and piles of goat meat.
It may mean that principles have to be swallowed along with the goat meat. The traditionalist views of tribal elders are a long way from the politically correct and gender-aware programmes of the blizzard of aid initiatives visited on Afghanistan since 2001.
Counter-insurgency manuals are now required reading in the British embassy in Kabul, and one of the main conclusions is that the conflict must be "Afghanised". Just as the Soviet Union made use of regional militias, so the west is now encouraging tribal militias to organise themselves against the Taliban. It is a high-risk strategy that could encourage civil war. But it may be the only way to reduce British troop numbers in the long run, given the weakness of other available forces.
The history of Afghanistan is that invaders and conventional forces invariably lose in the end. Just as the Russians did, the west faces a determined insurgency, financed from abroad and inspired by Islamist fundamentalism. The Taliban, with an endless supply of recruits from the madrasas across the frontier in Pakistan, could fight for ever. Taking ground is much easier than holding it.
After Gorbachev's change of policy in 1985, a new leader, Mohammad Najibullah, invited the mujahedin to what was supposed to be a reconciliation conference, while behind their back calling them "traitors and filthy vultures in the service of sworn enemies of our people; reactionary imperialists and neocolonialists".
It is the kind of rhetoric now being used about the Taliban by Brown and his government, and it may serve them just as badly as they get down to try deal-making on the ground.
David Loyn is a BBC world affairs correspondent. He is currently writing a history of foreign engagement in Afghanistan