The 1842 retreat from Kabul (or Massacre of Elphinstone's army) took place during the First Anglo-Afghan War. At the beginning of the conflict, British and East India Company forces had defeated the forces of Afghan Emir Dost Mohammad Barakzai and in 1839 occupied Kabul, restoring the former ruler, Shah Shujah Durrani, as emir. However a deteriorating situation made their position more and more precarious, until an uprising in Kabul forced the then commander, Major General Sir William Elphinstone, to withdraw the garrison. To this end he negotiated an agreement with Wazir Akbar Khan, one of the sons of Dost Mohammad Barakzai, by which his army was to fall back to the British garrison at Jalalabad, more than 90 miles (140 km) away. As the army and its numerous dependents and camp followers began its march, it came under attack from Afghan tribesmen. Many of the column died of exposure, frostbite or starvation or were killed during the fighting.
The Afghans launched numerous attacks against the column as it made slow progress through the winter snows of the Hindu Kush. In total the British army lost 4,500 troops, along with about 12,000 civilians: the latter comprising both the families of Indian and British soldiers, plus workmen, servants and other Indian camp-followers. The final stand was made just outside a village called Gandamak on 13 January.