The formation of the empire began with the capture of Lahore, by Maharaja Ranjit Singh, from its Afghan ruler, Zaman Shah Durrani, and the subsequent and progressive expulsion of Afghans from the Punjab, by defeating them 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 Maharaja Ranjit Singh, the empire was weakened by internal divisions and political mismanagement. Finally, by 1849 the state was dissolved after the defeat in the Anglo-Sikh wars. The Sikh Empire was divided into four provinces: Lahore, in Punjab, which became the Sikh capital, Multan, also in Punjab, Peshawar and Kashmir from 1799 to 1849.