Although the Mohammadzais continued to acknowledge the nominal overlordship of the Sadozai shahs, there was litter of the great kingdom of Ahmad Shah. Dost Mohammad took control of Kabul in 1826 and had no sooner proclaimed himself Amir of Afghanistan in 1835 when the Sikhs began to expand their claim to the Peshawar area. Since the Sikhs were tacitly supported by the British, Dost Mohammad asked the British governor general of India to intervene. In return, he implied that the Afghans could bolster the northwestern approaches to British India against the Russians. Dost Mohammad had come to the Afghan throne at the time of the two great empires were expanding: The Russians to the south and the British in India to the north. The land between the Hindu Kush remained between them. Dost Mohammad's Afghanistan was caught in the great powers' struggle in the 19th century (also known as THE GREAT GAME by Rudyard Kipling) which eventually became a buffer state between them.
The British garrisoned Kabul and put Shah Shuja on the throne, but they failed to realize that Afghan allegiance was not to a throne but to a chief among the chieftains. In a situation very similar to that of the Russian-supported government in Kabul in the 1980's, the reinstated Shah Shuja was a puppet monarch supported by foreign troops, soon found themselves the target of bloody resistance.
Shah Shuja had been murdered during the campaign by his own followers. After the British withdrew from Afghanistan, they released Dost Mohammad from exile. He returned to Kabul and was welcomed by his countrymen. Before he died in1863, he succeeded in unifying Afghanistan in bout the form of it is today.