The Treaty of Frankfurt, signed on 10 May 1871, saw France cede Alsace and the Moselle to Germany, thereby bringing to an end the Franco-German war which had been waged since 19 July 1870. The Empire of Napoleon III collapsed, to be replaced by the new German Empire.
Alsace was the scene of a whole series of bloody battles, notably at Morsbronn, Froeschwiller and Reichshoffen. These villages are known in French history as the pockets of a heroic resistance, which was, however, not enough to stave off defeat. One of the sorriest episodes of the war was the bombardment of Strasburg and the destruction of the library, containing Herrad of Landsberg´s famous Hortus deliciarum, one of the finest manuscripts of the 12th century. Colmar put up brave, but vain resistance, while Bartholdi and his fellow volunteers fought valiantly at the bridge of Horbourg on 14 September 1870.
Colmar lost a battle against overwhelming numerical superiority of the Baden troops and was captured by them. The French military authorities, refusing an open battle, ordered the garrison to withdraw to the Vosges. Mayor Peyerimhoff was made responsible for keeping order in the city and he declared Colmar to be an open city. Then, a period of uncertainty followed, with the city hovering anxiously between French and German domination before the first German officials marched in. The city council was kept in office, while the elections to the French constitutional assembly, which the occupying forces allowed to go ahead, were won by the patriotic list. This was no last gesture of defiance before the Treaty of Frankfurt. The highly liberal provisions of the Treaty allowed the inhabitants to opt for keeping French nationality; 3,587 of whom promptly did so (15 % of the population). Bartholdi himself took an oath never to return to his native city (an oath he was later to break).
Colmar therefore became part of Germany. The German administration sensibly enough allowed the city to remain the administrative capital of the region. The new Bezirk had the same boundaries as the old departement, except for the Territory of Belfort. The relocation of the Court of Appeal was avoided (by the skin of its teeth). By 1875, the population had reached its previous level, with 23,999 inhabitants. The exodus had been made up for by immigration, most of them civil servants, and by regular demographic growth.