At the outbreak of World War I Hoffmann became the first general staff officer of the German Eighth Army, responsible for defending their eastern border from a Russian attack. The bulk of the German Army, following the Schlieffen Plan, was attempting to gain decisive victory in the west by knocking France out of the war. Russian mobilization had begun secretly before the declaration of war, so earlier than anticipated the Russian First Army invaded East Prussia across its eastern frontier, the Eighth Army attacked them unsuccessfully at the Battle of Gumbinnen on 20 August 1914. Then they learned that the Russian Second Army was approaching their southern frontier in the west. To avoid being cut off the alarmed Eighth Army commander, Maximilian von Prittwitz, proposed to retreat over the River Vistula, abandoning East Prussia to the invaders. He soon reconsidered and instead decided to move the bulk of his forces to block the Russian Second Army from reaching the Vistula, but he and his chief of staff had already been relieved in favor of Paul von Hindenburg and Erich Ludendorff. Hoffmann knew Ludendorff well because they had been neighbors in the same building in Berlin for several years.