US forces have now stayed longer in Afghanistan than the Soviet army during Moscow's ill-fated intervention. The US military late last month exceeded the nine years and 50 days that Soviet troops were stationed in Afghanistan between 1979 and 1989. The event provoked queries about similarities between the American and Soviet experiences in Afghanistan, but US foreign policy experts irritably slapped down the idea that there could be any comparison between the two.
The presence of two powerful foreign armies in the same country within 12 years of each other, both fighting an Islamic fundamentalist-led insurgency, might be expected to produce some points in common. But members of the US-led coalition, the UN, and the Western media, have gone out of their way to distinguish between the two episodes. They firmly label the first period as "Soviet occupation", while the presence of 130,000 American and coalition troops keeping the Taliban at bay today is a "peacekeeping" or "stabilisation" mission. Coincidentally, the Soviet Union had almost the same number of soldiers in Afghanistan in the mid-1980s.
At first sight, the distinction between the two interventions appears reasonable. The first began suddenly on 27 December 1979, when 80,000 Soviet troops poured across the border and Soviet and Afghan soldiers burst into the presidential palace in Kabul to kill the Communist president, Hafizullah Amin. American intervention started less visibly, on 7 October 2001, when the US air strikes and Special Forces backed the opposition Northern Alliance to begin a campaign to drive the Taliban from power.
"When the Soviets came in, everybody wanted to fight against them," admits General Nur al-Haq Ulumi, a powerful leader under the Communist regime, who was military commander for the whole of southern Afghanistan. He adds that, in complete contrast, "when the Americans arrived in 2001, everybody supported them and nobody wanted to fight them."
The popularity of the Americans and their foreign allies has not lasted. They are increasingly blamed by Afghans for the continued violence and as sponsors and protectors of a deeply unpopular government. As the US, Britain and almost 50 other states reach their 10th year of military action in Afghanistan, the dilemmas facing them resemble the problems that the Soviet army wrestled with a quarter of a century ago.
The Soviet Union and the US both proved unable to break a military stalemate in which they occupied the cities and towns, but were unable to crush an Islamic and nationalist rebellion in the countryside, where three-quarters of Afghans still live. Geography has not changed. Today, as in the 1980s, the guerrillas cannot be conclusively defeated so long as they can move backwards and forwards across the 1,600-mile border with Pakistan and enjoy the support (open in the case of the Soviets; covert in the case of the Americans) of the Pakistani army.
Moscow and Washington each poured in troops, money, weapons and advisers to create an Afghan state that could stand on its own. The Soviets succeeded here better than the Americans, because the Communist regime survived for three years after the departure of the last Soviet troops, on 16 February 1989. Few believe that Afghan President Hamid Karzai's government could exist for anything like as long after the exit of foreign forces.
It is important not to draw too close an analogy between Soviet and American actions and intentions in two different eras. Soviet military ambitions were more limited than the US's. Their priority was to hold 25 cities, including Kabul, and the main roads linking them. They largely left the countryside to mujahidin, as the resistance fighters were known, though their shelling and bombing of villages drove four million Afghans into Pakistan. Even the most hawkish Soviet generals saw they could not hope to win without closing the Pakistan border, a mammoth task for which they never had enough soldiers.
American aims in the war are much more far-reaching. The US commander General David Petraeus is this year trying to inflict a significant military defeat on the Taliban in their southern strongholds in Helmand and Kandahar provinces. Heavy hints are dropped to foreign governments and media that the tide is turning. The 30,000 US troop reinforcements, bringing American troops levels up to 100,000, are assaulting Taliban base areas while US Special Forces claim successes in killing Taliban mid-level commanders.
These tactical gains have some significance, but perhaps less on the battlefield than as part of a propaganda effort by the US armed forces to persuade a dubious American public, and even more sceptical foreign allies, that the war is winnable. These apparent counter-insurgency successes may not mean very much, experienced observers say. The influential Brussels-based International Crisis Group poured scorn on them in a recently published report, saying that "contrary to the US rhetoric about the momentum shifting [against the Taliban], dozens of districts are now under Taliban control".
The focus of outsiders judging winners and losers in Afghanistan is too narrowly military. The Taliban have been able to expand their influence so rapidly across the country since 2006 not only through their military prowess and ferocity, but because they are punching into a vacuum. They are fighting an Afghan government which is seen as discredited and illegitimate by Afghans.
It was not always so. The great majority of Afghans were happy when the Taliban fell nine years ago. They believed a nightmare period in their history was over. The first elections for president and parliament were more or less honestly conducted, but since then, each poll has been more crooked than the previous one. The re-election last year of President Hamid Karzai, once genuinely liked and trusted, was openly fraudulent. The parliamentary election this year, results of which have just been announced, was even worse. The next parliament will be less representative than its predecessor. "I was interested to see that all the women in a Taliban-controlled district voted 100 per cent against me," said one defeated candidate with a cynical smile.
It is difficult to find anybody in Kabul these days who has a good word to say about Mr Karzai or his government. In the eyes of Afghans, the US, Britain and other foreign forces are keeping in power a political elite made up of racketeers and warlords. The coalition is losing the legitimacy it could claim when it supported a democratically elected government, making it look more and more like an occupation force.
The Taliban's military strength is limited and there are fewer of them than the mujahidin fighting the Soviet-backed Communist government in the 1980s. "There are between 12,000 and 20,000 full-time fighters today, while in the 1980s there were 75,000 mujahidin in Afghanistan and another 25,000 in eight training camps in Pakistan," says Said Mohammad Gulabzoy, interior minister between 1980 and 1989.
"The Taliban is weak but the government is weaker," says Daoud Sultanzoy, until recently a member of parliament for Ghazni. "It is the unpopularity of the government that gives the Taliban the oxygen to breathe." Mr Karzai does not have a core of supporters, but exists at the centre of a web of self-interested groups whose needs he tries to balance. Disillusionment is almost complete.
It is a measure of the appalling leadership of Afghanistan since the fall of the Communists in 1992 that one now frequently hears Afghans say that the last Communist president, Mohammad Najibullah, tortured and hanged by the Taliban in 1996, was the best of their recent leaders.
Are there lessons to be learnt and mistakes which can be avoided by comparing Soviet and American actions in Afghanistan? Why have these been ignored so far?
Almost every aspect of Afghan life has been studied by foreign experts in recent years, but with one surprising exception. "It is rather astonishing," says the German diplomat and Afghan expert Martin Kipping, writing in a private capacity for the highly regarded Afghanistan Analysts Network, "to see that so far, no systematic comparison has been drawn between the current US-led intervention and the previous external intervention aimed at strengthening and transforming the Afghan state: the Soviet intervention between 1979 and 1989." His own study seeks to remedy this.
The Soviet experience was ignored because it was seen as illegitimate compared with subsequent US action supported by the UN and Nato and by a popularly elected Afghan government.
A further reason for disregarding the lessons of the Soviet era in Afghanistan was the conviction that the Soviet army had been defeated by heroic mujahidin armed with Stinger missiles by the CIA. This is the theme of several films and has become a fixed belief of the American right.
This picture is mostly cold war mythology. The Soviet army retreated from Afghanistan in 1989 under a diplomatic agreement and without suffering a military defeat. There was no Dien Bien Phu. Soviet and Afghan troops had stabilised the military situation on the ground in 1983-84. The Stinger missiles made little difference. The Communist government of president Najibullah held on to power, to the surprise of US intelligence, for three years after the departure of the last Soviet soldier. However, the regime still needed money, weapons and fuel from Moscow and when these were cut off in 1992 after the break-up of the Soviet Union, the Najibullah government collapsed.
At no time did the Soviet army look like losing, but it also never came close to eliminating the Afghan resistance. It lost 13,310 soldiers and airmen killed over nine years, with the biggest losses in 1984, when 2,343 died, according to post-war statistics. Casualties were low compared with every other war fought by the Red Army in the 20th century.
The real disaster for the Soviet Union in Afghanistan was political. By sending in its army to fight a popular revolt, it isolated itself internationally and was portrayed as a predatory imperial power. All the obloquy which had been loaded on the US over the Vietnam War in the 1960s and 1970s was now directed at the Soviet Union in the 1980s. Seeking better relations with the West, the Kremlin intended to bring its troops home but without allowing the Communist government in Kabul to go down to defeat.
This it largely succeeded in doing, and here lie some lessons for the US. The Soviet Union took the decision to invade without reckoning on the international consequences. The Communists had seized power in a military coup in Kabul in 1978. They imposed their rule by savage repression while their leaders divided into factions and engaged in murderous feuds. The Soviet invasion turned a sporadic guerrilla war into a mass uprising, in which the government permanently lost control of the countryside to the mujahidin.
Former political and military leaders of the Afghan Communist government speak of important differences between now and then. General Ulumi, the all-powerful ruler of the southern provinces, says that the insurgents against Communist rule had the support of all the world, but the Taliban enjoy only secret backing from Pakistan.
He argues that, unlike the Karzai government, the Communists had a solid core of support in the cities and there were 200,000 members of the Communist Party. "I doubt if there are more than 40 people really loyal to Karzai," he says. "He does not even have the full support of his own cabinet." The Communists cultivated the urban population through providing jobs, housing and subsidies for food and essential goods. In combating the mujahidin, General Ulumi says he found political infiltration more effective than armed assault. Agreements were signed with insurgent commanders in which they promised not to fight or allow other anti-government fighters to pass through their districts. In return they received money and arms.
He says the Stingers "did not make much difference, except to raise the morale of the mujahidin temporarily and force our helicopters to fly low. We had plenty of tanks and artillery."
American intelligence imagined the Najibullah regime would collapse as soon as Soviet troops withdrew, but this did not happen. The insurgents launched a mass assault on Jalalabad in 1989, but failed to capture the city. By 1992, three-quarters of the mujahidin had signed neutrality agreements with the government.
The weakness of the Communists was that they had stabilised their rule through two "quick fixes", the development of militias (the Uzbek militia of General Abdul Rashid Dostum has 40,000 men) and the fragile ceasefire agreements with local mujahidin commanders. The support of both groups could be secured only by a continued supply of money and weapons from Moscow. When this failed, General Dostum and other commanders switched sides and the regime fell apart in April 1992.
The Kremlin in the 1980s always had a weaker hand to play than the US 20 years later, but after the initial disastrous decision to invade, the Soviet leaders played it skilfully. They forced out the ineffective president Babrak Karmal in 1986 and replaced him with the more effective Najibullah, the former intelligence chief. Two years later, under the Geneva Agreement, they got their own troops out without giving up their local proxy.
The lesson here for the US may be that it made a crucial error in not forcing the replacement of Mr Karzai after, or even before, the largely fraudulent election of 2009. As the batch of cables from the US embassy in Kabul leaked by WikiLeaks last week show, American diplomats see Mr Karzai's administration as saturated by corruption. They portray it as a money-making machine for its members, who, despite paltry salaries, buy multimillion-dollar mansions in Dubai.
By installing Najibullah as president in 1986, the Soviets ensured that their client regime had able and determined leadership. In sticking with a discredited Mr Karzai a quarter of a century later, the US and its allies landed themselves with an ineffective Afghan partner without a political base.
Can the US win the war by military force alone? This is the current strategy in south Afghanistan, though the Taliban are making inroads in the north and east. Small tactical successes are trumpeted, but are outweighed by the growing disaffection of Afghans against their own government. Mr Gulabzoy says: "People may not join the Taliban, but they will not support the government."
What should be dismaying for the US-led coalition is that it is not just former Communist leaders who express loathing for the government, but businessmen and professional people of all sorts in Kabul. "People are so angry that there will be a revolution," one estate agent in the capital said. US "quick fixes", such as setting up their own militias and pumping in aid, are not working and may be destabilising the situation further.
Some US officials wonder if they might not learn something from Soviet failures and successes. One tells of how a visiting delegation from Central Asia, which included a former Soviet general, visited a US base in east Afghanistan. Enthusiastic American officers explained the different ways they were trying to fight the insurgents and win the loyalty of the people. Eventually, the general cut them off and said wearily: "We tried all that when we were here and it didn't work then, so why should it work now?"