Ranbir Singh was the third son of Gulab Singh, the founder of the Jammu and Kashmir state. Ranbir Singh ascended the throne in 1856 after Gulab Singh's abdication due to his poor health. He allied with the British during the Sepoy Mutiny. Unlike European women and children, Indian mutineers were not allowed to take refuge in his state. He also sent his troops to help the British to besiege Delhi. He was subsequently rewarded for his behaviour during the mutiny. He went on to annex Gilgit which had previously witnessed a rebellion against the state. The princely states of Hunza and Nagar started paying tributes to Jammu and Kashmir during his reign. He also established a modern judicial system. Civil and criminal laws were compiled into the Ranbir Penal Code during his reign. Ranbir Singh was a scholar of Sanskrit and Persian languages and had many books translated.