When the Franco-Prussian War broke out, Bavaria fought on the side of its erstwhile enemy Prussia. Hartmann was given command of the II. Bavarian Army Corps, which was together with its sister Corps - I. Bavarian Army Corps under von der Tann - part of the III Army, led by the Crown Prince of Prussia. Hartmann lead the II Corps in the battles of Wissembourg, Wörth and Sedan. When the German armies neared Paris he fought in engagements at Corbeil, Bourg-la-Reine, Petit-Bicètre and Moulin de la Tour. On 19 September 1870 Hartmann defeated General Ducrot in an engagement at Sceaux.