Syed Ahmad Barelvi was born near Lucknow in the small town of Rai Bareli in 1786. His father died whilst he was still young and in 1806, he moved to Delhi and enrolled in Madrassa e Rahimya. For two years he studied under the sons of Shah Waliullah learning Holy Quran and Hadith. But Syed Ahmad was more a man of action than a scholar and in 1810joined the forces of Amir Khan, a pathan military leader. It was at this time that Syed Ahmad learned how to use European weapons. He showed himself to be so able that he was given command of group of soldiers. However, because of his piety he was also made responsible for leading troops in prayers. In 1817 Syed Ahmad returned to Delhi, where his work became more important in trying to restore Islam to its original purity.
As the man of action, Syed Ahmad was ideal person to act as a leader to work against the British power in India and to try to ensure that Muslims were ruled by their fellow Muslims.He believed that the freedom of Muslims could only come as a result of armed struggle against the foriegn and non Muslims forces who were opressing them. Syed Ahmad wanted to improve the lives of Muslims. Consequently, even when he served as army officer he surrounded himself with men of great piety who were prepared to reject worldly wealth and work for improving the moral and intellectual lives of Muslims. The British had ensured that the Mughals emperors had little power and Sikhs were dominent in Punjab. Syed Ahmad founded the Jihad movement, which called for armed struggle to overthrow non Muslim opression and restore Muslim power. He believed that once it was done , Islam could be rejuvenated and rescued from beliefs and customs contrary to Islamic beliefswhich had crept into the daily lives of Muslims.
In 1821, Syed Ahmad went for Hajj; before he travelled across India and held meetings in order to spread his beliefs about Jihad. When he returned from Arabia in 1823, he was ready to take action. At this time Punjab was under the control of sikh regime of Ranjit Singh, who had also extended his authority into North West Frontier Province. Syed Ahmad thought that Punjab was the place to launch his Jihad against non Muslim rulers. Syed Ahmad toured Punjab and NWFP to enlist men to fight the sikhs. He trevelled many hundred of miles to raise the mujahideen force. His traveks took him through Rajhastan, Sindh, Balouchistan and into Afghanistan. However he found that Afghan troops were suspicious of each other and not always prepared to join him in his Jihad. In 1826, Syed Ahmad estab;ished hi headquarters near Peshawar. He sent massage to Ranjit singh telling him that he must allow Muslims freedom of worship or face the mujahideen. Ranjit Singh dismissed the ultimatum, so Syed Ahmad was forced to attack first at Akora on 21 December 1826, and then shortly afterwards at Hazrothe; the sikhs suffered defeat. Syed Ahmad's victories established him as the successful military leader and encouraged other tribe to join the mujahideen. Soon army numbered 80,0000 strong. A major problem for Syed Ahmad, however was that his army consisted of different communities which disagreed that how compaign was fought. The sikhs tried to exploit these differences by calling them un Islamic. They claimed that by following the teachings of Shah Waliullah, Syed Ahmad's army was not true Muslims. This view was not accepted by the Muslim leaders. In 1827, they agreed unanimously that Syed Ahmad should assume the authority of an Imam. His words on religious matters was considered binding and his increased authority helped to unite the various Muslim groups forming the Mujahideen force. Syed Ahmad was preparing to attack the fort of attock when he encountered an army of 35000 Sikhs near Akora. What he did not know was that Yar Muhammad Khan, a pathan chief who had joined his forces, had been bribed by the Sikhs. First one of his servents tried to poison Syed Ahmad , Muhmmad khan deserted the battlefield along with his men thus creating a confusion and chaos in the ranks which ultimately led to the defeat of Syed Ahmad's forces. he had no other option but to move his headquarters to the safety of Panjtrar near Kashmir. Although yar Muhammad was later killed in battle against the Mujahideen, his brother Sultan Muhammad Khan also waged a war against Syed Ahmad. This constant compaigning against fellow Muslims was not what Syed Ahmad wanted, so he moved his forces to Balakot hoping to liberate Kashmir and Hazara. Balakot was thought to be safe as it was protected on three sides with the Mountains. But once again Syed Ahmad was betrayed when the local leaders told sikhs the way to the mountains. They made the surprised attack on the forces of Syed Ahmad. The battle of Balakot was fiercely contested one. Though the Mujahideen had been taken by surprise by a much larger Sikh army they fought bravely but were heavily outnumbered and unable to resist the Sikhs. Six hundred mujahideen soldiers were killed including Syed Ahmad and his commander, Shah Ismaeel.