context: The first Afghan war was fought in Afghanistan from 1838 to 1842. It was one of the first disputes between Britain and Russia to divide the powers in the Middle East, commonly known as the Great Game in English History. The British feared that Russia's advance in Central Asia would threaten British rule over India. The war broke out when the British wanted to replace Dust Muhammad, the Russian-ruled ruler of Afghanistan with the British-backed Shujaa Shah. Initially, the British army captured Kabul with relative ease and Shuja 'Shah was taken to the throne. However, he proved incapable and the British left the country in control. Anti-British sentiment in Afghanistan led to increasing resistance and William Elphinstone finally decided to evacuate the Kabul garrison to Jalalabad in the winter of January 1842. The British continued their retaliation to Afghanistan, but ended up returning the displaced Dust Muhammad to the throne of the country, after which they withdrew.
question: Why did the first Afghan war take place?
answers.text: divide the powers in the Middle East