The Sikh Empire (, ; , ) was a state originating in the Indian subcontinent, formed under the leadership of Maharaja Ranjit Singh, who established an empire based in the Punjab. The empire existed from 1799, when Maharaja Ranjit Singh captured Lahore, to 1849, when it was defeated and conquered in the First and Second Anglo-Sikh War. It 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.