The Egyptian Expeditionary Force had won the decisive Battle of Gaza in November 1917 under the newly appointed Commander-in-Chief of Palestine, General Sir Edmund Allenby. Following the Battle of Jerusalem in December, Allenby accepted the surrender of the city, which was placed under martial law, and guards were posted at several points within the city and in Bethlehem to protect sites held sacred by the Christian, Muslim and Jewish religions. Following a decisive British victory at the Battle of Megiddo, the Ottoman Empire formally surrendered on 30 October 1918, leaving the British in complete control of Palestine.