Two earlier attempts had been made to capture Gaza, on 26 March (First Battle of Gaza) and 19 April (Second Battle of Gaza). Both ended as costly failures and the two sides had reached a stalemate. This failure led to the removal of the British commanders, Murray and Dobell and on 28 June 1917 General Edmund Allenby, formerly commander of the British Third Army in France, took over command and assumed direct control over all future operations.
The 3rd attempt was sucessful under the command of General Allenby. They broke the Turkish defensive Gaza-Beersheba line. Allenby had 11 Divisions under his command, including the 10th Irish Division. The critical moment of the battle was the capture of the town of Beersheba on the first day by Australian Light Horse units.
There was virtual parity in numbers between the British and Turkish forces. The British had superior artillery plus naval support whereas the Turks held a supremely defensible position. Critically the British were superior in both quantity and quality of mounted troops. British commanders decided against renewing the frontal infantry assaults on Gaza. Even if it were captured, any advance north would be threatened by Turkish forces on the eastern flank.
The weakest point in the Turkish line was at their extreme left (east) flank at Beersheba, some 30 miles (48 km) from the coast. The Turks believed that it would be impossible to mount large scale operations on that flank because of the scarcity of water in the region, so one Turkish division was deemed sufficient for its defense. The British saw that it was the only sector that offered a good chance of a breakthrough and, by operating on the Turkish flank, the British could threaten to encircle the Turkish forces at Gaza by striking west towards the coast, cutting off the rail and road supply routes. Therefore, the problem became how to supply an attack in the east. The railway was to be driven eastwards from the coast. Water supplies were carried forward to dumps or to fill ancient Roman cisterns. Wells that had been destroyed by the Turks were repaired and engineers worked to develop water flow from marginal wells.
The attack on Beersheba was the key to the whole British plan, but the arrack got delayed and night was approaching. With time running out, the commander of the Desert Mounted Corps, Lieutenant General Chauvel, ordered the Australian 4th Light Horse Brigade to make a mounted attack. The 4th (Victorian) and 12th (New South Wales) Regiments of the brigade formed up in three waves and charged across 4 miles (6.4 km) of open terrain through shrapnel and machine gun fire. The audacity of their charge confused the Turkish defenders who failed to adjust their rifles' sights and so fired too high. As a consequence, the charge was incredibly successful and few casualties were incurred.
Turkish resistance in Beersheba quickly collapsed and they began to abandon the town in a panic. Many of the garrison were taken prisoner and most importantly the Turks only succeeded in destroying two out of the 17 wells. Furthermore, two reservoirs containing 90,000 gallons each were captured intact. Immediate relief for the horses was fortuitously provided by a torrential downpour that had preceded the battle and left pools of standing water.
By 4 November, engineers had managed to produce a water flow of 390,000 gallons a day at Beersheba, enough to support the British mounted forces. However, the Turks still held the water supplies to the north, at Khulweilfe, Jemmameh and Huj, so the mounted brigades could only operate away from Beersheba for one day at a time until these supplies were captured.
The first action at Gaza took place before dawn on 2 November, when the 54th Division attacked the Turkish trench system in the sand dunes between Gaza and the sea. On this occasion it was a night attack by well-prepared troops with overwhelming artillery support and six Mark IV tanks. The British infantry advanced about 2 miles (3.2 km) on a 5,000 yards (4.6 km) front and held their gains against repeated Turkish counter-attacks. Casualty figures were heavy for both sides but this time favoured the British.
The once-formidable Gaza-Beersheba line was now looking vulnerable. At dawn on 6 November, the next blow was struck by the British when all three divisions of Chetwode's XX Corps (including 10th Irish Division) attacked on a broad front near Sheria, about the midpoint of the Turkish line. The initial objectives were reached by 1 pm and, while the 74th Division was held up on the right, the 10th and 60th Divisions were through the Turkish defences by 2.30 pm, with the 60th Division capturing the railway station at Sheria. The XX. Corps and the cavalry felt their way into the hills north-east and north of Beersheba, wheeling north-eastward against the Sheria — Hareira line. By the night of 5th November the troops of assault were in position — the Sixtieth, Tenth, and Seventy-fourth Divisions on the left directed against Kauwukah, while the cavalry on the right moved against Sheria, with the Fifty-third Division on the extreme right flank.. The assault was delivered at dawn on the 6th, and by midday most of the objectives had been won. Kauwukah and Rushdi were taken, and Hareira entered; by the evening Yeomanry were in Sheria Station, and the Fifty-third Division had carried Tel el Khuweilfeh.
To the east, the 10th Division captured the Hareira Redoubt and the 60th Division captured Tel el Sheria. The final Turkish positions in the old defensive line, the Tank Redoubt and Atawineh Redoubt held by the Turkish 54th Division, were captured with little opposition by the 75th Division on 8 November.
The Gaza-Beersheba line was completely overrun and 12,000 Turkish soldiers were captured or surrendered. However, the sacrifice of the Turkish rearguards delayed the British pursuit and saved the army from encirclement and destruction. Allenby's objective was to capture of Jerusalem by Christmas 1917. Allenby delivered Jerusalem to London with over two weeks to spare.