c.1915–19 A photograph from 1915–19 of Jamrud Fort on the eastern end of the Khyber Pass. The fort was built in 1836–37 by the Sikh general Hari Singh Nalwa, a fort builder, after conquering the area from local tribesmen. Built with thick walls, the poorly protected fort was captured by the Afghans later in 1837. Jamrud later served as a British base, notably for operations in Afghanistan in 1878–79 and in the Tirah Campaign of 1897–98. It was the collecting station for the Khyber tolls and a base of the Khyber Rifles, an auxiliary unit for the army raised among local tribesmen.

Sardar Hari Singh Nalwa (1791-1837), the well-known Sikh general, proposed to build a big fort at Jamrud. The proposal was opposed; nevertheless the foundation of the fort that has survived was laid by General Hari Singh Nalwa on 6 Poh 1893 Sambat (18 December 1836) and the construction was completed in 54 days. “Jamrud…noted for its fort built with 10 feet (3 m) thick walls c.1836 by the Sikh Hari Singh Nalwa, one of Ranjit Singh’s generals, was originally named Fatehgarh to commemorate the Sikh victory over the disunited tribes.”

The establishment of unrivalled rule in the Punjab did not, however, provide for the removal of all threats: the Afghans were still in charge of the frontier and regularly took the opportunity to raid Sikh territory. In these early years of the nineteenth century, Afghanistan was riven with civil war as the multitudinous grandsons of Ahmad Shah Abdali fought each other for the throne. The kingdom descended into a period of vicious scheming in which princes were killed or blinded by their own brothers and no depravity was unexplored in the pursuit of the crown. Some of these royal pretenders sought succour from Ranjit, he being the new regional power most possessed of the capacity to assist their ambitions; one such supplicant was Shah Shujah, for a time king in Kabul before being deposed by Dost Muhammad. Ranjit agreed to ensure the safety of Shah Shujah, who then went into comfortable exile in British territory; the price of his rescue was the Koh-i-Noor. One of the great symbols of power in northern India was now in Sikh hands.

The other, however, was not: the Khyber Pass remained in Afghan territory, despite regular outbreaks of fighting between the Sikhs and their neighbours. In these first decades of the century, Peshawar changed hands several times, and the Sikh armies had some successes, but while the critical points of the frontier were out of their control, security would be elusive. It was not until late in the reign of Ranjit Singh that an attempt was made to fortify a border outside Peshawar in the hope of ending costly Afghan incursions. In 1836, the powerful Sikh general Hari Singh took charge of revitalising the frontier protections and built a fort at Jamrud, just outside Peshawar on the Khyber road. The rounded, pinkish castle that stands there today is of later British construction, but the value of a fortification at the site is clear, commanding as it does the approach to the mouth of the Khyber Pass.

Immediately upon its completion, Jamrud Fort became an alarm that set the Afghans on a path to war. The King of Kabul, Dost Muhammad, understood the fortifying of the frontier to mean that the Sikhs were planning an invasion of his territory and the capture of the Khyber Pass. Accordingly, he levied his forces – declaring a jihad against the infidel Sikhs – and advanced through the Khyber Pass in the spring of 1837, placing Jamrud Fort under siege on 23 April. Although the Sikh forces in the fort were under strength, and Hari Singh lay ill in Peshawar, stout resistance prevented the Afghan army taking the fort, even after heavy artillery bombardment; around 1,000 Sikhs held off an Afghan force of perhaps 25,000. Such an imbalance in numbers, however, made the Sikh position dangerous, as the Afghan army cut off all supplies of food and water and continued their shelling of the fort. The situation began to look hopeless. Sikh commanders inside the besieged stronghold met and decided that their only chance was to get a message to Hari Singh in Peshawar and trust in his bringing reinforcements to their aid. A volunteer was sought for the hazardous mission of taking a despatch through the siege lines, and it was a woman, Harsharan Kaur, who came forward. Accepting the risk of her death, Harsharan made her prayers, disguised herself as a dog, and set out in the middle of the night, walking on all fours, picking her way carefully through the Afghan encampments.

Against the odds, she was successful, and arrived in Peshawar several hours later: Hari Singh immediately ordered the cannon shot that would tell the besieged that rescue was on the way, and raised himself from his sickbed to set out to lift the siege. With his forces, Hari Singh advanced on Jamrud and heavy fighting took place outside the fort; eventually, the Afghan army began to lose ground and the Sikhs gained the advantage. Forced to raise the siege, the Afghans retreated the short distance into the Khyber. Once inside the Pass, the natural defensive excellence of the rocky cliffs provided refuge and respite for the retreating army, and hard fighting followed: for some time, both the Sikh and Afghan forces were static, none making headway amid such terrain. Eventually – despite the death of Hari Singh during this fighting – the Afghan forces withdrew and the Khyber Pass was finally in Sikh hands.

With their frontier now fixed upon the natural mountain border of the Subcontinent, the Sikhs had secured their kingdom and reached their apogee under Maharajah Ranjit Singh. Through long years of chaos – introduced in part by invasions through the Khyber Pass – Sikh rule had come to triumph, a native Indian state emerging from internal decay and outside invasion, just as the Mauryan Empire had done more than two thousand years before. This success was, however, long in coming but short in life: Ranjit Singh had taken the Sikhs to their most glorious days but his kingdom would not long outlast him. Just a few years after his death in 1839, Sikh rule in the Punjab was threatened by the rising new power in India: the British Raj.