When World War I erupted in 1917, British forces were defeated by the Ottomans in the first and second Battle of Gaza. General Edmund Allenby, leading the Allied Forces, finally conquered Gaza in a third battle.