
1757 saw the victory of Ahmed Shah Durrani and Kashmir went out to Pakistan until 1819, when Ranjit Singh won it again to annex it to his Sikh empire. In 1846, the British defeated the Sikhs and sold it to Ghulab Singh of Jammu for Rs 7.5 million under the Treaty of Amritsar and gave him the status of an independent princely ruler of Kashmir. He conquered Ladakh and added it to his dominion. Maharaja Ghulab Singh died in 1857 and was succeeded by Maharaja Rambir Singh. Maharaja Partab Singh and Maharaja Hari Singh ruled over Kashmir in succession.
The India-Pakistan partition took place during the reign of Hari Singh in 1947 and the rulers of princely states were given the choice to freely accede to either India or Pakistan or to remain independent. However, since the Maharaja of Kashmir was a Hindu, he chose to join India despite the majority of the Muslim population in his dominion. However, since then there have been controversies over the decision and Pakistan claims that the decision was partial and the region should be a part of its dominion.