Moguer could not escape this situation. The population decreased significantly. Nonetheless, the rise of Moguer in terms of relative importance was recognized in 1642 when Philip IV granted Moguer the title of a "city" (ciudad). The eighteenth century was characterized by economic, political and technical stability. Land, controlled in large part by the local oligarchy, continued to be much in demand by moguereños, who purchased small tracts. As for commerce, the wine industry grew, supplying Cádiz and exporting to an expanding market in the Americas, Russia and other countries in Europe, as well as supplying the Spanish Royal Navy. The 1755 Lisbon earthquake caused extensive damage in the city, leaving only the strongest buildings standing: part of the castle, the Santa Clara Monastery and the Chapel of the Hospital. Other buildings had to be rebuilt or restored—as was the Convent of San Francisco, rebuilt in the mannerist style—or built from scratch—as were the city hall, a masterpiece of civil Baroque, or the Parish Church of Our Lady of Granada, which retained only its original 14th-century tower. Because of the dramatic 18th-century increase in the population, this church was enlarged to cathedral proportions, with five naves, the highest and widest being the central nave. For wartime services to the Crown against England, in 1779 Charles III granted the City of Moguer the titles of Muy Noble and Muy Leal ("Very Noble" and "Very Loyal"). Contemporary history The story of 19th-century Moguer is essentially that of 19th-century Spain. At the beginning of the century, Moguer was the most populous centre in its part of Spain (7,200 inhabitants) followed by Huelva. The French invasion during the Peninsular War left a general sense of provisionality and bewilderment. Briefly in the 1822 territorial division of Spain and then permanently in the 1833 division, a province was established with Huelva as its capital, despite a long and bitter verbal struggle to make Moguer the capital of the new politico-administrative unit. Moguer remained, however, as head of a new legal district (partido judicial) and notarial and registrational districts () having also comarcal courts, a court of first instance and an examining magistrates court (). Ecclesiastically, Moguer had been the seat of the vicarage of the same name since the mid-15th century and also core of a deanery (arciprestazgo) whose area was broader than the old parish, which only extended as far as Palos de la Frontera. The