Jerusalem had been the target of the British effort in Palestine since the end of March 1917. At first it had been seen as part of a wider plan to combine a Russian offensive in the Caucasus, a British advance from Baghdad and the fall of Jerusalem to force the Turks to sue for peace. Later, after the spring of 1917 had seen the failure of the Allied offensive on the western front, the French mutiny and the rise of the U-boat threat, the capture of Jerusalem began to be seen as a much needed morale boost for the British population.
In June 1917 General Sir Edmund Allenby arrived to take command of the British forces in Egypt, then held up in front of the Turkish defences of Gaza. After careful preparation Allenby successfully implemented a plan already under consideration for an attack around the Turkish left. The resulting third battle of Gaza (31 October-7 November) forced the Turks to abandon the position at Gaza, and retreat back towards Gaza. An attempt to defend the railway linking Jerusalem to the north failed (battle of Junction Station, 13-14 November), splitting the Turkish armies in Palestine in two.
Allenby then attempted to take advantage of the rapid Turkish retreat to attack Jerusalem. The resulting battle of Nebi Samwil, 18-24 November, saw the British attempt to cut the road from Jerusalem to Nablus by sweeping through the Judean Mountains. It ended in failure when Turkish resistance proved to be more determined than expected.
In the aftermath of this battle, Allenby settled down to improve his supply lines and move new troops towards Jerusalem. XXI corps, who had conducted most of the pursuit after Gaza, was moved to the coast, while XX corps, who had made the crucial breakthrough at Beersheba on 31 October, moved up to take their place in the hills west of Jerusalem.
The attack by XXI corps had seen the British attempt to pivot on their right wing, and cut the Nablus road some way to the north of Jerusalem. General Sir Philip Chetwode, the commander of XX corps, decided to attempt the opposite move. XX corps would pivot on their left. Their right wing would advance almost directly towards Jerusalem, pass close to the north west of the city and get onto the Nablus road much further south.
The main advantage of this plan was that the advance could be supported from the main road from Ramleh to Jerusalem. However, it would require an attack on the main defences of Jerusalem. These had been created a year earlier by blasting trenches out of the rocky hills west of the city. In places they were three tiers high, and should have been almost impossible to attack.
Fortunately for the British, since the end of the first attack on Jerusalem the Turks had launched a series of determined but costly counterattacks with their best troops. When the British attack began early on 8 December Turkish resistance was much less stubborn than expected. At the end of the day the British had pushed the Turks out of their strongest positions, and made the evacuation of the city inevitable.
The last Turkish troops left Jerusalem early on the morning of 9 December. Just after noon on the same day the Mayor of Jerusalem presented the keys of the city to General Shea, the commander of 60th Division. His division would also see the most fighting on 9 December. A Turkish rearguard had been left in the Mount of Olives, and a bayonet charge was needed to force it out.
By the end of the day British divisions were in place all around Jerusalem. On 11 December General Allenby made his formal entry into the city. The Turks would mount one counterattack, on 26 December, but without success.