After the death of Ahmad Shah, Punjab was freed from Afghan rule by Sikhs for a brief period between 1773 and 1818. At the time of the formation of the Dal Khalsa in 1748 at Amritsar, Punjab had been divided into 36 areas and 12 separate Sikh principalities, called Misl. From this point onward, the beginnings of a Punjabi Sikh Empire emerged. Of the 36 areas, 22 were united by Maharaja Ranjit Singh. The other 14 accepted East India Company sovereignty. After Ranjit Singh's death, assassinations and internal divisions severely weakened the empire. Six years later, the British East India Company was given an excuse to declare war, and in 1849, following the first and Second Anglo-Sikh Wars, Punjab was annexed by the East India Company. In the Indian Rebellion of 1857, the Sikh rulers backed the East India Company, providing troops and support. However, in Jhelum, 35 British soldiers of HMXXIV regiment were killed by the local resistance, and in Ludhiana, a rebellion was crushed with the assistance of the Punjab chiefs of Nabha and Malerkotla.