Madrid is a relatively young capital compared with Rome, Paris or London: for centuries it was a small Castilian town, and its fortunes began only when a king decided to make it the seat of the court. This page traces the main stages. It is part of the Madrid guide; for the national picture see the history of Spain.
- 852-886Emir Muhammad I of Córdoba builds the fortress of Mayrit above the Manzanares.
- 1085Alfonso VI of Castile takes Madrid, in the campaign that leads to the capture of Toledo.
- 1202Alfonso VIII grants Madrid its charter, the Fuero.
- 1561Philip II settles the court in Madrid, which becomes the capital.
- 1601-1606The court moves to Valladolid for five years, then returns for good.
- 1619The Plaza Mayor is completed.
- 1734A fire destroys the Habsburg Alcázar; work begins on the new Royal Palace.
- 1759-1788Reign of Charles III, "Madrid's best mayor".
- 1808On 2 May the city rises against Napoleon's troops.
- 1819The Prado Museum opens.
- 1919The first metro line opens.
- 1936-1939During the civil war Madrid resists Franco's siege for almost three years.
- 1975-1978Franco dies and the transition to democracy begins; the Movida is born.
- 1983The Autonomous Community of Madrid is created.
- 2004On 11 March bombings on commuter trains kill 192 people.
- 2021The Paseo del Prado and the Retiro join the UNESCO World Heritage list.
Mayrit, the Arab fortress
In the 9th century the Umayyad emir of Córdoba, Muhammad I, built a fortress on a hill above the Manzanares to defend Toledo against the Christian kingdoms of the north. Its Arabic name, Mayrit, probably refers to the area's underground watercourses. A stretch of the Arab walls survives on Cuesta de la Vega, below Almudena cathedral, whose legend tells of an image of the Virgin hidden in the walls and found after the conquest.
The Castilian town
In 1085 Alfonso VI of Castile took Madrid. For the next five centuries it was a medium-sized town inhabited by Christians, Muslims and Jews, host to some meetings of the Cortes and an occasional royal residence, its kings drawn by forests full of game. From this period comes St Isidore, a 12th-century farm labourer who became the city's patron saint.
Habsburg capital
In 1561 Philip II decided to settle the court in Madrid, at the centre of the peninsula, near the building site of the Escorial monastery. The city boomed: from about twenty thousand inhabitants it grew to over a hundred thousand in a few decades. It was the age of the Golden Age: Cervantes, Lope de Vega, Calderón, Quevedo and Velázquez lived in Madrid, and the Plaza Mayor hosted festivals, bullfights and autos-da-fé. But the city grew chaotically, with narrow, dirty streets: it was called the "Madrid of convents" for its dozens of religious houses.
The Bourbons and the Enlightenment
With the arrival of the Bourbons in 1700 Madrid changed face. Philip V built the new Royal Palace, and above all Charles III, formerly King of Naples, transformed the city with great public works: street lighting, paving, sewers, the Puerta de Alcalá, the Paseo del Prado with the Botanical Garden, the Observatory and the museum that would become the Prado, the Cibeles fountain. His favourite architect was the Italian Francesco Sabatini.
2 May and the 19th century
On 2 May 1808 Madrileños rose against Napoleon's French troops occupying Spain: the revolt was bloodily suppressed, with executions immortalised by Goya, and began the War of Independence. The 19th century was one of revolutions and coups, but also of modernisation: the railway arrived, the Canal de Isabel II brought water from the sierra, and the Ensanche created the Salamanca and Chamberí districts. In the early 20th century the Gran Vía and the metro opened.
The civil war
During the civil war (1936-1939), Madrid was the symbol of Republican resistance: in November 1936 Franco's troops reached the city's gates, in the Casa de Campo and University City, but were stopped to the cry of ¡No pasarán!. The city held out for almost three years under bombardment, until surrendering in March 1939. See the Spanish Civil War.
From Francoism to democracy
The post-war years were a time of hunger and repression; then in the 1950s and 1960s Madrid grew enormously with migration from the countryside, absorbing neighbouring towns. After Franco's death in 1975 the city lived through the democratic transition and the explosion of the Movida madrileña under mayor Enrique Tierno Galván. Since the 1990s Madrid has become a European metropolis, a financial centre and a destination for immigrants from Latin America and the world. On 11 March 2004 Islamist bombings on commuter trains, killing 192 people, left a deep mark on the city.
Why Madrileños are called cats
People born in Madrid to Madrilenian parents are jokingly called gatos, cats. Legend says that during the 1085 conquest one of Alfonso VI's soldiers climbed the Arab walls with a cat's agility to plant the Christian flag: from then on he and his descendants were known by that name.
For the monuments linked to this history see what to see in Madrid and the Madrid of the Austrias.