The history of Azad Kashmir, a part of the Kashmir region administered by Pakistan, is related to the history of the Kashmir region during the Dogra rule. Azad Kashmir borders the Pakistani provinces of Punjab and Khyber Pakhtunkhwa to the south and west respectively, Gilgit–Baltistan to the north, and the Indian union territory of Jammu and Kashmir to the east. Jammu and Kashmir (princely state) The princely state of Jammu and Kashmir came into being in 1846 after the First Anglo-Sikh War. Prior to that, Jammu was a tributary of the Sikh empire based in Lahore. Gulab Singh, formerly a footman in the Maharaja Ranjit Singh's army who distinguished himself in various campaigns, was appointed as the Raja of Jammu in 1822. The Valley of Kashmir was also a part of the Sikh empire, ruled through a separate governor. Raja Gulab Singh successively fought and captured Rajouri (1821), Kishtwar (1821), and through his general Zorawar Singh, Suru valley and Kargil (1835), Ladakh (1834–1840), and Baltistan (1840). He became a wealthy and influential noble in the Sikh court. During the First Anglo-Sikh war in 1845–1846, Gulab Singh sided with the British, leading to a Sikh defeat. In the ensuing Treaty of Lahore, the Sikhs were made to cede Kashmir and Hazara to the British, in lieu of their indemnity, and to recognize Gulab Singh as an independent Mahraja. A week later, in the Treaty of Amritsar, Gulab Singh paid the British the indemnity that was due from the Sikhs, and acquired Kashmir in return. Thus Gulab Singh became the Maharaja of the state of Jammu and Kashmir, founding a new Dogra Dynasty. The Treaty of Amritsar continues to be widely regarded by the Kashmiris as a "sale deed". In 1856, Gulab Singh abdicated in favour of his son Ranbir Singh, who became the Maharaja. During the Indian Mutiny of 1857, Ranbir Singh again came to the aid of the British and was duly rewarded. During Ranbir Singh's rule, Kashmir faced oppressive despotism, as recognized by British observers. In 1860, Ranbir Singh annexed Gilgit.