March 1917, Atatürk was promoted from the command of the XVI Corps to the overall command of the Second Army, although the Czar's armies were soon withdrawn when the Russian Revolution erupted. In July 1917, he was appointed to the command of the Seventh Army, replacing Fevzi Pasha on 7 August 1917, who was under the command of the German general Erich von Falkenhayn's Yildirim Army Group (after the British forces of General Edmund Allenby captured Jerusalem in December 1917, Erich von Falkenhayn was replaced by Otto Liman von Sanders who became the new commander of the Yıldırım Army Group in early 1918.) Atatürk did not get along well with General von Falkenhayn and, together with Miralay İsmet Bey, wrote a report to Grand Vizier Talaat Pasha regarding the grim situation and lack of adequate resources in the Palestinian front. However, Talaat Pasha ignored their observations and refused their suggestion to form a stronger defensive line to the north, in Ottoman Syria (in parts of the Beirut Vilayet, Damascus Vilayet, and Aleppo Vilayet), with Turks instead of Germans in command. Following the rejection of his report, Atatürk resigned from the Seventh Army and returned to Constantinople. There, he was assigned with the task of accompanying the crown prince (and future sultan) Mehmed Vahideddin during his train trip to Austria-Hungary and Germany. While in Germany, Atatürk visited the German lines on the Western Front and concluded that the Central Powers would soon lose the war. He did not hesitate to openly express this opinion to Kaiser Wilhelm II and his high-ranking generals in person. During the return trip, he briefly stayed in Karlsbad and Vienna for medical treatment. When Mehmed VI became the new Sultan of the Ottoman Empire in July 1918, he called Atatürk to Constantinople, and after several meetings in the months July and August 1918, reassigned him to the command of the Seventh Army in Palestine. Atatürk arrived in Aleppo on 26 August 1918, then continued south to his headquarters in Nablus. The Seventh Army was holding the central sector of the front lines. On 19 September, at the beginning of the Battle of Megiddo, the Eighth Army was holding the coastal flank but fell apart and Liman Pasha ordered the Seventh Army to withdraw to the north in order to prevent the British from conducting a short envelopment to the Jordan River. The Seventh Army retired towards