On the death of Charles II, broke the Spanish Succession War, in which Madrid supported from the beginning to Philip of Anjou as Philip V. While the city was occupied in 1706 by the Anglo-Portuguese army, who proclaimed king of the Archduke Charles of Austria under the name of Carlos III, and again in 1710, remained loyal to Felipe V (after his second entry into Madrid, the Archduke Charles made the comment "this city is a desert.")
Felipe V begin planning an incipient reform of the capital. The first urban transformation began in the southwest suburbs in the district of Marqués de Vadillo (1715-1730). Under the leadership of Pedro de Ribera, rise Toledo Bridge and access and planned the left bank of the Manzanares, which the church of the Virgen del Puerto. At the same time, it started building the Royal Palace, whose construction began in 1738 at the site of the old palace was destroyed by a incencio in 1734 (in any case, the excessive austerity of the castle was not very pleasing to the king, used to French courts.) Construction of the palace was entrusted to Juan Bautista Sachetti and lasted until 1764, and in the reign of Carlos III, speaking in her architects Sabatini and Ventura Rodríguez.
Following the reforms of Ferdinand VI, who built the convent of the Salesian Real (Madrid), Carlos III accedes to the throne, to be known as the best mayor of Madrid. Carlos III Madrid intend to make a capital worthy of the name, to building rides, building sewer systems and street lighting, street paving and ornaments of the city with various monuments. Also began construction of cemeteries in the outskirts of the city rather than in churches and convents.
Despite being known as one of the biggest benefactors of Madrid, its beginnings were not entirely peaceful, as in 1766 had to overcome the mutiny of Squillace, a pop traditionalist abetted by the nobility and the clergy against the winds that brought renewal Carlos III as an excuse to put on clothing decree ordering the shortening of the layers and the banning of the hats that hide their faces.
An institution typically illustrated, the Real Sociedad Economica de Amigos del Pais (born ten years earlier in the Basque Country) was founded in Madrid in 1775 version with the nickname Matritense initiative of Campomanes. It is based in the Tower of Lujanes, compared ayuntamiento.19
The reign of Charles III dated Basilica San Francisco el Grande (1761-1770), the post office (1766-1768), now the seat of the Presidency of the Community of Madrid, the Royal Customs House (1769), Current headquarters of the Ministry of Finance, the Puerta de Alcalá (1769-1778) and the Palacio de Benavente, the current Ministry of Defence (1777).
Other milestones include the opening to the public from Parque del Buen Retiro (1761), the start of construction of the Salon del Prado (1775, later Paseo del Prado), with sources of Neptune, Apollo and Cybele) and the Museo del Prado ( 1785), initially conceived as a Cabinet of Natural History. The reconstruction of the General Hospital (1776, now Museo Nacional Centro de Arte Reina Sofia and the creation of the Botanical Garden (1781), replacing the previous de Migas Calientes. It also enables the project Cuesta de San Vicente (1767 - 1777) and built the Royal Street.
The reign of Charles IV, in the midst of the catastrophes that plague Europe, is not very meaningful to Madrid. The only event of note is the beginning of the final remodeling of the Plaza Mayor (1790).
The population of the city grew with the progress and peace experienced since the arrival of Ferdinand VI. In 1787 he performed the official census pimer Madrid, which attests to the existence of 156,672 inhabitants in the city.
However, the city, girdled by the close of 1625, does not grow accordingly. This pushed up housing prices, and to be built in any hole available, thereby increasing the unsanitary and overcrowded. Still, the most disadvantaged people could not even aspire to a miserable little room inside the fence, so they are forced to settle elsewhere. Arise in this way urban slums south of the city, such as libel and Peñuelas, and a few more decent to the north, like Chamberí.