sentences:  During the Middle Ages, the city was protected by moats, walls and towers, and a church was built, later becoming a cathedral.In the 16th century the town was one of the last strongholds in the Revolta de les Germanies (local guilds).It also supported Archduke Charles of Austria in the War of the Spanish Succession (1701–14), but was later taken by the troops of Philip d'Anjou.