In the early 19th century, the British were concerned that Afghanistan could be a target for the Russian expansion. The British agreed with the Sikh ruler of Punjab, Ranjit Singh, that Afghanistan should remain independent, but they hoped Ranjit Singh would help them install a pro-British ruler in Kabul. However, Ranjit Singh did not support them and so the British went ahead on their own. A rebellion in Afghanistan in 1841 led to all British troops being killed.