In 1830, Syed Ahmad Barelvi defeated Sultan Mohd Khan, the chief of Peshawar who paid tribute to Bhatti Jatsikh ruler Maharaja Ranjit Singh. Syed started mobilizing people against the Sikhs and made plans to attack Hazara.
In May 1831, Kanwar Sher Singh accompanied by Sardar Pratab Singh of Attariwala and Ratan Singh Garjakhia, arrived in this region. The total strength of the troops under Sher Singh was about 5,000. He invested Balakot on all sides. The Syed had between 2,000 and 3,000 men. The Lahore Army slowly advanced narrowing the besieged area gradually. On 8th May on reaching near the Syed’s well-guarded and fortified residence, the Sikhs attacked. In the subsequent fight the Syed and 500 of his followers were killed including the Maulvi Ismail and Bahram Khan. The Lahore army won and this increased the prestige of Prince Sher Singh at Lahore Darbar.
Syed had introduced number of ‘reforms’ which was resented by local Muslims including introduction of 10% ashar tax, pilgrimage to the tombs of saints to make offerings and soliciting favours were denounced and prohibited. The Tazias of Shias were forbidden. Fireworks and sweet pudding (halwa) on Shab-e-Barat were condemned among others. The ill-will between Hindustani followers of Syed and Pathans developed into open hostility after the battle of Shaidu. Syed was thought to be close to his Hindustani followers than locals.
British did nothing to stop and completed ignored Syed when he raised the banner of Jihad against Maharaja in UP. The superior military and artillery of Maharaja won the day but historians like HR Gupta felt that Syed kept Maharaja busy in Frontier or else he would have concentrated on capturing Sindh.