With the failure of the Burnes mission (1837), the governor general of India, Lord Auckland, ordered an invasion of Afghanistan, with the object of restoring shah Shuja (also Shoja), who had ruled Afghanistan from 1803 to 1809. From the point of the view of the British, the First Anglo-Afghan War (often called "Auckland's Folly") was an unmitigated disaster. The war demonstrated the ease of overrunning Afghanistan and the difficulty of holding it.
An army of British and Indian troops set out from the Punjab in December 1838 and by late March 1839 had reached Quetta. By the end of April the British had taken Qandahar without a battle. In July, after a two-month delay in Qandahar, the British attacked the fortress of Ghazni, overlooking a plain that leads to India, and achieved a decisive victory over the troops of Dost Mohammad, which were led by one of his sons. The Afghans were amazed at the taking of fortified Ghazni, and Dost Mohammad found his support melting away. The Afghan ruler took his few loyal followers and fled across the passes to Bamian, and ultimately to Bukhara, where he was arrested, and in August 1839 Shuja was enthroned again in Kabul after a hiatus of almost 30 years. Some British troops returned to India, but it soon became clear that Shuja's rule could only be maintained by the presence of British forces. Garrisons were established in Jalalabad, Ghazni, Kalat-iGhilzai (Qalat), Qandahar, and at the passes to Bamian.
Omens of disaster for the British abounded. Opposition to the British-imposed rule of Shuja began as soon as he assumed the throne, and the power of his government did not extend beyond the areas controlled by the force of British arms.
Dost Mohammad escaped from prison in Bukhara and returned to Afghanistan to lead his followers against the British and their Afghan protege. In a battle at Parwan on November 2, 1840, Dost Mohammad had the upper hand, but the next day he surrendered to the British in Kabul. He was deported to India with the greater part of his family. Sir William Macnaghten, one of the principal architects of the British invasion, wrote to Auckland two months later, urging good treatment for the deposed Afghan leader.
Shuja did not succeed in garnering the support of the Afghan chiefs on his own, and the British could not, or would not, sustain their subsidies. When the cash payments to tribal chiefs were curtailed in 1841, there was a major revolt by the Ghilzai.
By October 1841 disaffected Afghan tribes were flocking to the support of Dost Mohammad's son, Muhammad Akbar, in Bamian. Barnes was murdered in November 1841, and a few days later the commissariat fell into the hands of the Afghans. Macnaghten, having tried first to bribe and then to negotiate with the tribal leaders, was killed at a meeting with the tribal chiefs in December. On January 1, 1842, the British in Kabul and a number of Afghan chiefs reached an agreement that provided for the safe exodus of the entire British garrison and its dependents from Afghanistan. Unfortunately, the British would not wait for an Afghan escort to be assembled, and the Ghilzai and allied tribes had not been among the 18 chiefs who had signed the agreement. On January 6 the precipitate retreat by some 4,500 British and Indian troops with 12,000 camp followers began and, as they struggled through the snowbound passes, the British were attacked by Ghilzai warriors. Although a Dr. W. Brydon is usually cited as the only survivor of the march to Jalalabad (out of more than 15,000 who undertook the retreat), in fact a few more survived as prisoners and hostages. Shuja remained in power only a few months and was assassinated in April 1842.
The destruction of the British garrison prompted brutal retaliation by the British against the Afghans and touched off yet another power struggle among potential rulers of Afghanistan. In the fall of 1842 British forces from Qandahar and Peshawar entered Kabul long enough to rescue the British prisoners and burn the great bazaar. All that remained of the British occupation of Afghanistan was a ruined market and thousands of dead (one estimate puts the total killed at 20,000). Although the foreign invasion did give the Afghan tribes a temporary sense of unity they had lacked before, the accompanying loss of life (one estimate puts the total killed at 25,000) and property was followed by a bitterness and resentment of foreign influence that lasted well into the twentieth century and may have accounted for much of the backlash against the modernization attempts of later Afghan monarchs.