After the series of Central Powers defeats in Palestine at the end of 1917, at Beersheba, at Gaza, at Mughar Ridge, and with the loss of large areas of southern Palestine during the subsequent retreats of the Seventh and Eighth Armies back into the Judean Hills, and following the loss of Jerusalem, several of the German and Ottoman army commanders in the region were replaced. General Erich von Falkenhayn commanding the Yildirim Army Group was replaced by General Otto Liman von Sanders and Friedrich Freiherr Kress von Kressenstein, commander of the Eighth Army was replaced by Djevad Pasha. Cemal Pasha appointed Cemal Kucjuk Pasha to command the Fourth Army. The commander of the Seventh Army, Mustafa Kemal who had previously resigned his command, was reinstated early in September 1918.