The town fell into ruin but its church was first constructed in the 7th century. By 1112, it was the seat of the Margraviate of Baden. The Lichtenthal Convent (') was founded in 1254. The margraves initially used Hohenbaden Castle (the Old Castle, '), whose ruins still occupy the summit above the town, but they completed and moved to the New Castle ("") in 1479. Baden suffered severely during the Thirty Years' War, particularly at the hands of the French, who plundered it in 1643. They returned to occupy the city in 1688 at the onset of the Nine Years' War, burning it to the ground the next year. The margravine Sibylla rebuilt the New Castle in 1697, but the margrave Louis William removed his seat to Rastatt in 1706. The Stiftskirche was rebuilt in 1753 and houses the tombs of several of the margraves.