The Sikh Empire (also Sikh Khalsa Raj or Sarkar-i Khalsa) was a state originating in the Indian subcontinent, formed under the leadership of Maharaja Ranjit Singh, who established a secular empire based in the Punjab. The empire existed from 1799, when Ranjit Singh captured Lahore, to 1849 and was forged on the foundations of the Khalsa from a collection of autonomous Sikh misls. At its peak in the 19th century, the Empire extended from the Khyber Pass in the west to western Tibet in the east, and from Mithankot in the south to Kashmir in the north. Religiously diverse, with an estimated population of 3.5 million in 1831 (making it the 19th most populous country at the time), it was the last major region of the Indian subcontinent to be annexed by the British Empire.