The Egyptian Expeditionary Force (forces of the British Empire in Egypt) led by Archibald Murray had twice failed to capture Turkish held Gaza.
In June 1917 Edmund Allenby took command from Murray. Prime Minister, David Lloyd George told Allenby that he should seek to take Jerusalem for the allies by Christmas of that year.
In order to fulfil his mission Allenby knew that it was vital to break the Turkish line at Gaza. The two failed attempts to break the line had been frontal attacks on the town of Gaza. Allenby decided to mount an initial attack on the less heavily defended area of Beersheba.
Water supply had also played a part in the two earlier failed attempts to secure Gaza so securing water supply for the troops was essential. Allenby determined that for the mission to be successful Beersheba had to be taken quickly and therefore posted a large force in front of Gaza and ordered the town to be bombarded.
On 31st October 1917 the attack on Beersheba began. Infantry forces attacked from the front while cavalry forces attacked from the east. The battle continued for much of the day until an Australian light cavalry force broke the Turkish defence and secured the water supply. Attacks on Gaza on 1st and 2nd November forced the Turks to retreat to Tel El Khuweilfe. On 3rd November forces of the Egyptian Expeditionary force advanced to Tel El Khuweilfe. Successive attacks on 4th and 5th November were repulsed.
Meanwhile, an attack was planned to break the Turkish line at Sheria. The attack began on 6th November forcing the Turks to retreat. On 7th November a major assault was launched on Gaza which succeeded in securing the town for the allies bringing an end to the third battle of Gaza.
The allied advance continued and Jerusalem was captured on 9th December.