1520, asked the Duke of the Infantado, Diego Hurtado de Mendoza, to join the anti-imperial revolt. The demonstrators lit the houses of the procurators who went to the Cortes of La Coruña to vote in favour of the taxes and obligations levied by Emperor Charles V. The Duke of Infantado played a cautious waiting game to see which side would win, finally choosing to endorse the Emperor in 1521. He ordered the beheading of the local leaders of the insurgency and the deportation of his own son and successor Íñigo López de Mendoza, who had leaned towards the comunero cause. By 1591, the city had a population of 6,754. Crisis The Crisis of the 17th century took a heavy toll in many Castilian cities, and particularly in Guadalajara. The city was affected by the 1610 expulsion of the moriscos both in terms of the net demographic loss (10% of the population) as well as by their critical weight in key sectors of the local economy such as the artisanate and trade. Many palaces were left forsaken. The Mendozas left the city for good in 1657. During the War of the Spanish Succession, in the early 18th century, Guadalajara was sacked. Ravaged by the Austracist army, a largely ruined Guadalajara hit then its lowest demographic point, with only around 2,200 inhabitants. Without external assistance the city may have simply ceased to exist. The 20,000,000 maravedies indebted to the Royal Treasury were forgiven in 1716. Philip V ordered the establishment of the Real Fábrica de Paños (Royal Factory of Clothes), which was opened in the city in 1719 in the Palacio del Marqués de Montesclaros, critically helping the city to move on from the calamitous situation it found itself. Contemporary times The 19th century started with two major setbacks: the damages caused by the Peninsular War (1808–1814) and the closing of the Real Fábrica de Paños in 1822. In 1808, Guadalajara was taken by the French Army led by General Hugo and the city was destroyed. During the war, the 14 convents in the city were abandoned and turned into barracks, paving the way for the future processes of desamortización, most decisively in between 1833 and 1843. The desamortización entailed the change of use of religious buildings (turned to hospitals, high schools, military workshops), the demolition of some convents to widen street space and to erect new residential areas, and the reduction