Carcassonne was an important military and commercial center in southern France. A key stronghold since Roman times and the capital of a county by the ninth century, Carcassonne was as much a military center as any castle. Having survived many sieges, it was abandoned in 1240 and rebuilt by Louis IX in 1248. The city has double curtain walls; the outer has twenty towers and the inner, twenty-five (see Figure 13). Some of the towers are independent fortresses and even have their own wells. A barbican and complex outerworks guard the main city gate. The architect Viollet-le-Duc restored the medieval city in the nineteenth century, adding conical tiled roofs inappropriate to southern French architecture. The citadel is rectangular in plan, with rooms and towers arranged around an open central courtyard. A deep moat cuts the citadel off from the city.