Colmar is first mentioned in Charlemagne's chronicle of the Saxon wars. In 884 the emperor Charles the Fat held a diet here. In 1226 Frederick II made it a free imperial city, and in 1354 it joined the Décapole, a league of cities.
Église Saint-Martin was begun in 1234 and finished in 1365, and the old customs house, the Koïfhus, went up in 1480. After the French Revolution the collections of local convents passed to the town, which is why the municipal library holds over 2,300 incunabula, an unusual number for a city without a major university.
The Reformation came late: Colmar adopted it in 1575, well after Strasbourg and Sélestat. The Maison Pfister (1537), the Corps de garde (1575) and the Maison des Têtes (1609) are all in a German Renaissance style. Swedish troops took the town in 1632 and held it for two years.
Louis XIV's army took Colmar in 1673, and the 1679 Treaties of Nijmegen made it French. The buildings changed style: the hospital (1736–1744) and the Hôtel de Ville (1790) are French Classicism. Yet the town kept a German character through its language and culture.
In 1871 Colmar went to the new German Empire after the Franco-Prussian War. The railway station of 1905 is German Neo-Baroque, a leftover of that period. France got the city back in 1919.
Nazi Germany annexed Colmar in 1940. Liberation came on 2 February 1945, after the battle of the Colmar Pocket, and no other French town waited longer. The photographs of Nazi flags in these streets are still startling.
Today tourism is the main business. The city is affluent, and it also hosts the European seat of Timken and the French seats of Liebherr and Leitz. The conservative parties have run it since 1947, with only three mayors in that time.