Castelnau entered the army during the Franco-Prussian war, and was chosen as General Joffre's Chief of Staff in July, 1912. He assisted in the creation of Plan XVII, and became commander of the Second Army in Lorraine in August, 1914. Castelnau was able to halt the German counterattack at Nancy, and he, along with most of his troops, were then transferred to the French left flank during the Race to the Sea, rejoining the front near Amiens on 23-24 September. Becoming commander of the Centre Army Group in 1915, he planned and directed the Champagne offensive. Castelnau made the recommendation to Joffre that General Petain be given command at Verdun, and then later resumed command in Lorraine in September-November 1918.