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 Second Anglo-Sikh War. It was forged on the foundations of the Khalsa from a collection of autonomous Sikh Misl. 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 Umerkot in the south to Kashmir in the north. It was divided into four provinces: Lahore, in Punjab, which became the Sikh capital; Multan, also in Punjab; Peshawar; and Kashmir from 1799 to 1849. Religiously diverse, with an estimated population of 4.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. The foundations of the Sikh Empire can be traced to as early as 1707, the year of Aurangzeb's death and the start of the downfall of the Mughal Empire. With the Mughals significantly weakened, the Sikh army, known as the Dal Khalsa, a rearrangement of the Khalsa inaugurated by Guru Gobind Singh, led expeditions against them and the Afghans in the west. This led to a growth of the army which split into different confederacies or semi-independent misls. Each of these component armies controlled different areas and cities. However, in the period from 1762 to 1799, Sikh commanders of the misls appeared to be coming into their own as independent. The formation of the empire began with the capture of Lahore, by Ranjit Singh, from its Afghan ruler, Zaman Shah Durrani, and the subsequent and progressive expulsion of Afghans from the Punjab, by capitalizing off Afghan decline in the Afghan-Sikh Wars, and the unification of the separate Sikh misls. Ranjit Singh was proclaimed as Maharaja of the Punjab on 12 April 1801 (to coincide with Vaisakhi), creating a unified political state. Sahib Singh Bedi, a descendant of Guru Nanak, conducted the coronation. Ranjit Singh rose to power in a very short period, from a leader of a single misl to finally becoming the Maharaja of Punjab. He began to modernise his army, using the latest training as well as weapons and artillery. After the death of