QuestionSpain
What Is the Capital of Spain? Madrid Explained

Madrid is the capital of Spain and, with about 3.4 million residents, also its largest city. It has been the seat of the Spanish court since 1561, and Article 5 of the 1978 constitution names the “town of Madrid” as the capital of the state. The city lies near the geographic center of the Iberian Peninsula.
Contents
Madrid: Spain’s capital at a glance
Madrid is the capital of both Spain and the surrounding autonomous Community of Madrid. According to the municipal register of Spain’s National Statistics Institute (INE), the city has about 3.4 million inhabitants, and the Community of Madrid around 7 million. That makes Madrid the second most populous city proper in the European Union, after Berlin.
The city stands on the Meseta Central plateau at around 650 m (2,130 ft) above sea level, making it one of the highest capital cities in Europe. The Manzanares River runs through its western side. Madrid has hot, dry summers and cool winters with frequent frost, a sharper contrast than in coastal Spanish cities.
Madrid is the political, financial and cultural center of the country. It hosts the national parliament, the ministries, the Supreme Court, the Constitutional Court and the Banco de España, as well as the headquarters of many of Spain’s largest companies.
Why did Madrid become the capital?
In the Middle Ages, Spanish kings had no fixed capital. The royal court traveled between cities such as Toledo, Valladolid, Burgos and Seville, staying where it was needed. Madrid itself began as a fortress built by the Muslim emir Muhammad I of Córdoba in the 9th century and was taken by King Alfonso VI of León and Castile in 1083 or 1085.
In 1561, King Philip II moved the court permanently to Madrid. He left no written explanation, so historians point to several likely reasons:
- Central location: Madrid lies almost in the middle of the peninsula, so royal orders could reach every region relatively quickly.
- Water and space: the town had good water supplies and room to grow, unlike Toledo, which is squeezed onto a rocky hill above the Tagus.
- Independence from rival powers: Toledo was dominated by the archbishop, the head of the Spanish church, while Madrid had no comparable local power.
- Nearby royal sites: Madrid was close to royal hunting grounds and to El Escorial, the monastery-palace Philip II built from 1563.
The decision was reversed only once. Under Philip III, the court moved to Valladolid from 1601 to 1606, before returning to Madrid for good. Because Madrid was formally a villa (town) rather than a ciudad (city), it is still nicknamed la Villa y Corte, “the town and court.”
Other capitals in Spain’s history
Several cities have served as capitals of the kingdoms that later formed Spain:
| City | Role |
|---|---|
| Toledo | Capital of the Visigothic kingdom (6th–8th centuries) and a major royal seat of Castile |
| Córdoba | Capital of the Umayyad emirate and caliphate of al-Andalus (756–1031) |
| Oviedo and León | Capitals of the early Christian kingdom of Asturias and León |
| Valladolid | Seat of the court from 1601 to 1606 |
| Cádiz | Seat of the Cortes that wrote the constitution of 1812, during the Napoleonic occupation |
During the Spanish Civil War, the Republican government left Madrid in late 1936, moving first to Valencia and then to Barcelona, while the Nationalist side was based in Burgos. Madrid regained its role as capital when the war ended in 1939.
Where does the government sit?
Madrid is the seat of all three branches of the national government. The Congress of Deputies meets in the Palacio de las Cortes, a 19th-century building with two bronze lions at its entrance, and the Senate in the Palacio del Senado. The President of the Government works and lives at the Moncloa Palace in the northwest of the city.
The Royal Palace of Madrid, built in the 18th century on the site of the old Muslim fortress, is the official residence of the Spanish monarch and one of the largest royal palaces in Europe. In practice it is used for state ceremonies and receptions, while the royal family lives at the smaller Zarzuela Palace on the edge of the city.
Is Barcelona the capital of Spain?
No. A common confusion, especially among international visitors, is that Barcelona is the capital. Barcelona is the capital of the autonomous community of Catalonia and Spain’s second-largest city, with about 1.7 million residents. It hosted the 1992 Summer Olympics and is famous for Gaudí’s architecture, which helps explain why it is so well known abroad.
Other autonomous communities also have their own capitals, such as Seville for Andalusia, Valencia for the Valencian Community and Santiago de Compostela for Galicia. None of these is the national capital. For more about Spain’s cities and regions, see what Spain is known for.
Famous landmarks of Madrid
Madrid’s best-known sights include:
- The Prado Museum, opened in 1819, with major works by Velázquez, Goya and El Greco. Together with the Reina Sofía and Thyssen-Bornemisza museums, it forms the “Golden Triangle of Art” along the Paseo del Prado.
- The Plaza Mayor, a large arcaded square completed in the 17th century.
- The Puerta del Sol, home to the “Kilometer Zero” plaque from which Spain’s national roads are measured.
- Retiro Park, a former royal garden laid out in the 17th century. The Paseo del Prado and Retiro area was added to the UNESCO World Heritage List in 2021.
- The Santiago Bernabéu stadium, home of Real Madrid.
Neighboring Portugal’s capital, Lisbon, lies about 500 km (310 mi) to the west in a straight line, at the mouth of the Tagus River, the same river that flows past Toledo.
More on Big World List
- Chronicle · historyDos de Mayo Uprising (1808): Madrid Rises Against France
Frequently asked questions
Is Barcelona the capital of Spain?
No. Barcelona is the capital of the autonomous community of Catalonia and Spain's second-largest city, with about 1.7 million residents. The capital of Spain is Madrid.
When did Madrid become the capital of Spain?
King Philip II moved the royal court to Madrid in 1561, and it has been the capital ever since, apart from the years 1601 to 1606, when the court sat in Valladolid. The 1978 constitution confirms Madrid as the capital of the state.
What was the capital of Spain before Madrid?
Before 1561 Spain had no fixed capital, because the court traveled between cities. Toledo and Valladolid were the most important royal seats, and Toledo had earlier been the capital of the Visigothic kingdom.
How many people live in Madrid?
The city of Madrid has about 3.4 million residents according to Spain's National Statistics Institute (INE), which makes it the second most populous city in the European Union after Berlin. The wider Community of Madrid has around 7 million people.
Why is Madrid the capital of Spain?
Madrid lies almost exactly in the center of the Iberian Peninsula, which made it convenient for governing the whole country. When Philip II chose it in 1561 it also had good water supplies, open space to grow and no powerful nobles or archbishop to rival the king.
Where does the Spanish government sit in Madrid?
The parliament meets in Madrid: the Congress of Deputies in the Palacio de las Cortes and the Senate in the Palacio del Senado. The President of the Government works from the Moncloa Palace, and the Royal Palace is used for state ceremonies.
Sources and further reading
- Spanish Constitution (1978), Article 5
- National Statistics Institute of Spain (INE), "Municipal Register"
- Encyclopaedia Britannica, "Madrid"
Cite this page
“What Is the Capital of Spain? Madrid Explained.” Countries of the World, https://countries.bigworldlist.com/questions/what-is-the-capital-of-spain/.
Spain: more questions and guides
- Country profileSpain Facts: Capital, Population, Regions and Culture
- ListCountries With a King or Queen: Monarchies of the World
- FlagFlag of Spain: Meaning, Colors, Coat of Arms and History
- ComparisonSpain vs Portugal: Iberian Neighbors Compared Side by Side
- ListSpanish-Speaking Countries: All 20 Where Spanish Is Official
- QuestionWhat Currency Does Spain Use? The Euro and the Old Peseta
- QuestionWhat Is Spain Known For? Landmarks, Food, Art and Culture
- QuestionWhat Is the National Animal of Spain? The Bull Explained
- QuestionWhat Is the National Dish of Spain? Paella and Other Classics