The Battle of Ali Masjid, which took place on 21 November 1878, was the opening battle in the Second Anglo-Afghan War between the British forces, under Lieutenant-General Sir Samuel James Browne, and the Afghan forces, under Ghulam Haider Khan. The perceived offence of an Afghan general's refusal to allow a British envoy entrance to the country was used as an excuse to attack the fortress of Ali Masjid, as the opening battle in the war. Despite numerous setbacks, including half the troops getting lost or delayed and missing the battle entirely, the British were lucky that the Afghans abandoned their position overnight.
Context
Following the 1837 Battle of Jamrud, Dost Muhammad Khan had built the fortress of Ali Masjid to assert his sovereignty over the Khyber region. However, the fortress was captured only two years later by 11,000 troops commanded by Lt. Col. Claude Martin Wade on 26 July 1839.
On 21 September 1878, two months before the battle, British envoy General Neville Chamberlain had tried to enter Kabul, but had been ordered to withdraw by Faiz Muhammad, the commander of Ali Masjid. Britain issued an ultimatum demanding that Sher Ali apologise for the incident.
On 23 October, a group of scouts was sent to reconnoitre the fortress, and assess Afghan defences in preparation for an invasion.
Battle
Preparation
The First Brigade had started training for the attack during the summer while they were stationed in the Miree Hills.
At sunset on 20 November 1878 an estimated 1,700 men of the Second Brigade of the Peshawar Valley Field Force began their flank march to assist Browne in his attack on the Ali Masjid fort which guarded the Khyber pass. The darkness created confusion and led to men and animals wandering off, it was 10 pm before the troops all reached Lahore settlement, which was only 5.5 km away from Ali Masjid.
The First Brigade brought an approximated 1,900 men, most of whom were hampered by the puttees they wore in place of gaiters, which tightened around their legs due to the climate and caused leg cramps. This battalion did not reach the Lahore settlement until 6 am on 21 November, just as the first battalion was preparing to leave, nevertheless they did their best to keep up. Colonel Jenkins led the scouts in this brigade.
Due to the heat, insufficient water supplies, and lack of shaded areas, Brigadier-General J. A. Tytler had to call for a halt at Pani Pal. While the men rested Tytler decided to check whether their left flank and rear were in danger. As Jenkins led a party out to scout the hills, a reverberation filled the air which Jenkins claimed was the firing of heavy guns. Tytler decided the best course of action would be if he stayed behind in Pani Pal with some men and Jenkins led the rest onward; that way Tytler was able to defend rear flank of Jenkins' troops should the need arise.
Afghan defence
The Afghans had 24 cannon. When Browne's troops were first spotted on the Shagai ridge there were already 8 cannon mounted to defend that, the southern face, of the fort; upon the arrival of troops on the Shagai ridge two more cannon were brought out to defend this side. A single gun was placed to protect the fort against an attack from the direction of the Khyber River. Facing the Rotas Heights, five guns were set up by the men of Ali Masjid.
Shooting begins
Afghan horsemen held the top of the Shagai ridge, so Browne ordered opening skirmish fire at 10 am, which led to a brief return of gunfire from the Afghans before they rode off the ridge, leading the 81st Foot, 14th Sikhs and a battery of mountain artillery to advance to within sight of Ali Masjid. Major. H. B. Pearson led signallers to hold the Sarkai ridge and set up heliographs to communicate with the troops left in Jamrud.
Artillery opened fire at noon, with sources disagreeing which side began the formal hostilities. As the British rushed to bring their own heavy guns up to the ridge, Brigadier-General MacPherson's First Brigade opened fire from the right flank of the fortress. Within an hour, the British had both 40 lb and 9 lb cannon replacing their horse artillery, while the Afghans were underequipped with only round shot ammunition, rather than proper shells. Around 2 pm, two British 40 lb shot hit and collapsed the central bastion of the fortress, silencing a "stubborn" Afghan 7 lb gun.