Following British defeats at the First and Second battles of Gaza in March and April 1917, Lieutenant General Philip Chetwode commanding the EEF's Eastern Force and Kress von Kressenstein's Ottoman Empire force had each adopted a defensive posture and a stalemate had developed in Southern Palestine. Entrenched defences approximately on the lines held at the end of the second battle were strengthened, and both sides undertook regular mounted reconnaissances into the open eastern flank. In late June, Allenby replaced General Archibald Murray as commander of the EEF, which he quickly reorganised. At about the same time, the Ottoman Fourth Army was also restructured. As the stalemate continued in terrible conditions through the summer, reinforcements began to arrive to replace the large number of casualties suffered by the EEF during the previous fighting for Gaza, while several additional divisions also arrived. The Ottoman defenders were also reinforced at this time, and both sides carried out training while manning the front lines and monitoring the open eastern flank. By mid-October, as the Battle of Passchendaele continued on the Western Front, the last of the British reinforcements arrived as Allenby's preparations to commence a campaign of manoeuvre neared completion.