Records survive of Roman knowledge of the area's springs. The present name first appeared as the seat of a court held by Charlemagne in the 8th century while trying the rebellious dukes of Alemannia and Bavaria. Cannstatt was the capital of the county of Württemberg into the 14th or 15th century; the Rotenberg was the location of the ruling house's ancestral castle. Cannstatt subsequently formed part of the duchy, electorate, and kingdom of Württemberg. It lay about from Stuttgart proper, although it has since grown to include Bad Cannstatt. In the 13th or 14th century, Louis the Bavarian expanded its rights and privileges to equality with Esslingen. Its 15th-century cathedral was dedicated to St Uffo. In 1755, the Great Lisbon earthquake caused the town hall to subside about . During the wars which followed the French Revolution, the town was the site on 21 July 1796 of a French victory over the Austrian Empire.