Sayyid Ahmed Barelvi declared war against Maharaja Ranjit Singh and recruited many Muslims from madrassas. However the Yousufzai and Muhammadzai Khawaneen didn't like his egalitarian ideals and betrayed Sayyid Ahmed Shahid and his army at the battle of Balakot and supported the Sikh Army in the Battle of Balakote in 1831, and Barelvi's head was severed by the Sikh General Hari Singh Nalwa.[58][59]