on the site of the former madrasa built by Yusuf I. Granada's Town Council did not fully establish until almost nine years after the Castilian conquest, upon the concession of the so-called 'Constitutive Charter' of the Ayuntamiento of Granada on 23 September 1500. From then on, the municipal institution became a crucible for the "Old Christian" and the converted morisco elites, resulting in strong factionalism, particularly after 1508. The new period also saw the creation of a number of other new institutions such as the Cathedral Cabildo, the , the Royal Chapel and the Royal Chancellery. For the rest of the 16th century the Granadan ruling oligarchy featured roughly a 40% of (Jewish) conversos and about a 31% of hidalgos. From the 1520s onward, the mosque structures themselves began to be replaced with new church buildings, a process which continued for most of the century. In December 1568, during a period of renewed persecution against moriscos, the Second Morisco Rebellion broke out in the Alpujarras. Although the city's morisco population played little role in the rebellion, King Philip II ordered the expulsion of the vast majority of the morisco population from the Kingdom of Granada, with the exception of those artisans and professionals judged essential to the economy. The expelled population was redistributed to other cities throughout the Crown of Castile. The final expulsion of all moriscos from Castile and Aragon was carried out between 1609 and 1614. Later history and present day During the 17th century, despite the importance of immigration, the population of the city stagnated at about 55,000, contrary to the trend of population increase experienced in the rural areas of the Kingdom of Granada, where the hammer of depopulation caused by the expulsion of the moriscos had taken a far greater toll in the previous century. The 17th-century demographic stagnation in the city and overall steady population increase in the wider kingdom went in line with the demographic disaster experienced throughout the century in the rest of the Crown of Castile. The city was overshadowed in importance by other cities including Seville and the capital, Madrid. Between 1810 and 1812 Granada was occupied by Napoleon's army during the Peninsular War. The French troops occupied the Alhambra as a fortified position and caused significant damage to the monument. Upon evacuating the city, they attempted to dynamite the whole complex, successfully blowing up eight towers before the remaining