World War I: First Battle of Gaza: British troops are halted after 17,000 Turks block their advance.

The First Battle of Gaza was fought on 26 March 1917, during the first attempt by the Egyptian Expeditionary Force (EEF) to invade the south of Palestine in the Ottoman Empire during the Sinai and Palestine Campaign of the First World War. Fighting took place in and around the town of Gaza on the Mediterranean coast when infantry and mounted infantry from the Desert Column, a component of the Eastern Force, attacked the town. Late in the afternoon, on the verge of capturing Gaza, the Desert Column was withdrawn due to concerns about the approaching darkness and large Ottoman reinforcements. This British defeat was followed a few weeks later by the even more emphatic defeat of the Eastern Force at the Second Battle of Gaza in April 1917.

In August 1916 the EEF victory at Romani ended the possibility of land-based attacks on the Suez Canal, first threatened in February 1915 by the Ottoman Raid on the Suez Canal. In December 1916, the newly created Desert Column's victory at the Battle of Magdhaba secured the Mediterranean port of El Arish and the supply route, water pipeline, and railway stretching eastwards across the Sinai Peninsula. In January 1917 the victory of the Desert Column at the Battle of Rafa completed the capture of the Sinai Peninsula and brought the EEF within striking distance of Gaza.

In March 1917, two months later, Gaza was attacked by Eastern Force infantry from the 52nd (Lowland) Division reinforced by an infantry brigade. This attack was protected from the threat of Ottoman reinforcements by the Anzac Mounted Division and a screen from the Imperial Mounted Division. The infantry attack from the south and southeast on the Ottoman garrison in and around Gaza was strongly resisted. While the Imperial Mounted Division continued to hold off threatening Ottoman reinforcements, the Anzac Mounted Division attacked Gaza from the north. They succeeded in entering the town from the north, while a joint infantry and mounted infantry attack on Ali Muntar captured the position. However, the lateness of the hour, the determination of the Ottoman defenders, and the threat from the large Ottoman reinforcements approaching from the north and north east, resulted in the decision by the Eastern Force to retreat. It has been suggested this move snatched defeat from the jaws of victory.

World War I, often abbreviated as WWI or WW1, also known as the First World War and contemporaneously known as the Great War and by other names, was an international conflict that began on 28 July 1914 and ended on 11 November 1918. It involved much of Europe, as well as Russia, the United States and Turkey, and was also fought in the Middle East, Africa and parts of Asia. One of the deadliest conflicts in history, an estimated 9 million were killed in combat, while over 5 million civilians died from occupation, bombardment, hunger or disease. The genocides perpetrated by the Ottomans and the 1918 Spanish flu pandemic spread by the movement of combatants during the war caused many millions of additional deaths worldwide.In 1914, the Great Powers were divided into two opposing alliances: the Triple Entente, consisting of France, Russia, and Britain, and the Triple Alliance, made up of Germany, Austria-Hungary, and Italy. Tensions in the Balkans came to a head on 28 June 1914 following the assassination of Archduke Franz Ferdinand, the Austro-Hungarian heir, by Gavrilo Princip, a Bosnian Serb. Austria-Hungary blamed Serbia and the interlocking alliances involved the Powers in a series of diplomatic exchanges known as the July Crisis. On 28 July, Austria-Hungary declared war on Serbia; Russia came to Serbia's defence and by 4 August, the conflict had expanded to include Germany, France and Britain, along with their respective colonial empires. In November, the Ottoman Empire, Germany and Austria formed the Central Powers, while in April 1915, Italy joined Britain, France, Russia and Serbia as the Allied Powers.

Facing a war on two fronts, German strategy in 1914 was to defeat France, then shift its forces to the East and knock out Russia, commonly known as the Schlieffen Plan. This failed when their advance into France was halted at the Marne; by the end of 1914, the two sides faced each other along the Western Front, a continuous series of trench lines stretching from the Channel to Switzerland that changed little until 1917. By contrast, the Eastern Front was far more fluid, with Austria-Hungary and Russia gaining, then losing large swathes of territory. Other significant theatres included the Middle East, the Alpine Front and the Balkans, bringing Bulgaria, Romania and Greece into the war.

Shortages caused by the Allied naval blockade led Germany to initiate unrestricted submarine warfare in early 1917, bringing the previously neutral United States into the war on 6 April 1917. In Russia, the Bolsheviks seized power in the 1917 October Revolution and made peace in the March 1918 Treaty of Brest-Litovsk, freeing up large numbers of German troops. By transferring these to the Western Front, the German General Staff hoped to win a decisive victory before American reinforcements could impact the war, and launched the March 1918 German spring offensive. Despite initial success, it was soon halted by heavy casualties and ferocious defence; in August, the Allies launched the Hundred Days Offensive and although the German army continued to fight hard, it could no longer halt their advance.Towards the end of 1918, the Central Powers began to collapse; Bulgaria signed an Armistice on 29 September, followed by the Ottomans on 31 October, then Austria-Hungary on 3 November. Isolated, facing revolution at home and an army on the verge of mutiny, Kaiser Wilhelm abdicated on 9 November and the new German government signed the Armistice of 11 November 1918, bringing the fighting to a close. The 1919 Paris Peace Conference imposed various settlements on the defeated powers, the best known being the Treaty of Versailles. The dissolution of the Russian, German, Ottoman and Austro-Hungarian empires led to numerous uprisings and the creation of independent states, including Poland, Czechoslovakia and Yugoslavia. For reasons that are still debated, failure to manage the instability that resulted from this upheaval during the interwar period ended with the outbreak of World War II in 1939.