The Entente Powers had declared war on the Ottoman Empire in November 1914. In early 1915 and in August 1916 the Ottomans, with German commanders, aid and encouragement, had attacked the Suez Canal, a vital link between Britain and India, Australia and New Zealand. Under General Archibald Murray, the British Egyptian Expeditionary Force (EEF) stopped the Ottoman army at the Battle of Romani and drove them back to Magdhaba and across the Sinai to Rafa to reoccupy Egyptian territory and secure the safety of the Suez Canal. Having constructed a railway and water pipeline across the desert, Murray then attacked southern Palestine. In the First Battle of Gaza and the Second Battle of Gaza in March and April 1917, the British attacks were defeated.