Following the First Anglo-Sikh War and the Treaty of Amritsar (1846), all the territories between the Ravi River and the Indus were transferred to Gulab Singh, and he was recognised as an independent Maharaja of Jammu and Kashmir. Thus Rajouri became a part of the princely state of Jammu and Kashmir. Gulab Singh changed the name of Rajouri to Rampur. He appointed Mian Hathu as Governor of Rajouri, who remained in Rajouri up to 1856. Mian Hathu constructed a stunning temple in between Thanna Nallah in close proximity to Rajouri city. He also built Rajouri Fort at Dhannidhar village.