The Sikh general, Nathu Shah, left garrison troops and Karim Khan ruled until Gilgit was ceded to Gulab Singh of Jammu and Kashmir in 1846 by the Treaty of Amritsar, and Dogra troops replaced the Sikh in Gilgit.