Madrid is the capital of Spain. It has held that role continuously since 1561, when Philip II moved the royal court there from Toledo, with only a five-year interruption in the early 1600s. The city sits almost exactly at the geographic center of the Iberian Peninsula, at roughly 646 meters above sea level, and the wider Community of Madrid holds about 6.7 million residents, according to Spain's national statistics institute, the INE.
Madrid's Role as Capital Is Fixed by Law, Not Custom
Spain's capital is defined in Article 5 of the 1978 Constitution, which states that the capital of the State is the city of Madrid. That's an unusually explicit constitutional anchor; many countries leave the capital designation to statute or tradition. The law is short, unambiguous, and has not been amended since the Constitution was ratified in December 1978.
What the Constitution does not do is explain why Madrid. That answer comes from history. Before 1561, Spain had no single fixed capital in the modern sense. The court of the Habsburg monarchs traveled, and the seat of government shifted among Valladolid, Toledo, and other cities depending on the king's preference and political calculation.
Philip II's decision to settle the court in Madrid in 1561 was partly geographic and partly strategic. Madrid sat near the center of the peninsula, roughly equidistant from the major ports and the older power centers, and it had a royal palace, the Alcázar, that could house the court. The move turned a mid-sized town into the administrative hub of a global empire.
The only break in continuity came between 1601 and 1606, when Philip III moved the court to Valladolid. The experiment lasted five years before the court returned to Madrid, and the city has held the role ever since. That five-year gap is the one detail most brief answers omit, and it matters because it explains why Madrid's claim is continuous but not unbroken.
Madrid Compared With Spain's Other Major Cities
Madrid is not Spain's largest city by every measure, and it is certainly not the only city foreigners mistake for the capital. The table below puts Madrid next to Barcelona, Spain's second city, and Seville, the historic capital of the south, using municipal population figures from the INE's 2024 municipal register, the padrón municipal.
| City | Role | Municipal population (INE, 2024) | Region | Key distinction |
|---|---|---|---|---|
| Madrid | Capital of Spain | About 3.3 million | Community of Madrid | Seat of government, royal palace, Prado museum |
| Barcelona | Regional capital of Catalonia | About 1.7 million | Catalonia | Mediterranean port, 1982 Olympic host |
| Seville | Regional capital of Andalusia | About 680,000 | Andalusia | Historic trade gateway to the Americas |
| Toledo | Former court city | About 85,000 | Castilla-La Mancha | Seat of the Spanish Church, pre-1561 court |
| Valladolid | Former court city | About 300,000 | Castilla y León | Hosted the court 1601–1606 |
The verdict here is simple: Madrid is the capital because the Constitution says so and because the court settled there in 1561. Barcelona is the capital of Catalonia, not of Spain, and Seville is the capital of Andalusia. That distinction trips up a surprising number of visitors, and it is worth fixing before you book a train.
A common confusion is that Barcelona is the capital because it is Spain's most internationally visible city. It isn't, and hasn't been since the crown moved to Madrid in the 16th century. If you want the seat of national government, you take the train to Madrid.
What Madrid's Capital Status Means in Practice
Capital status in Spain is not purely ceremonial. Madrid houses the Congress of Deputies, the Senate, the Royal Palace, and the official residence of the Prime Minister at the Moncloa complex. It also hosts the headquarters of the Bank of Spain and the central offices of most national ministries. If a decision affects the whole country, it is almost certainly made in Madrid.
For travelers, this concentrates a specific set of sights into one city. The Prado, the Reina Sofía, and the Thyssen-Bornemisza museums line the Paseo del Prado, a boulevard UNESCO added to its World Heritage list in 2021 as part of the "Paseo del Prado and Buen Retiro, a landscape of Arts and Sciences" listing. The Royal Palace, the Almudena Cathedral, and the Plaza Mayor sit within walking distance of each other in the historic center.
Madrid's elevation shapes the experience in ways tourists notice immediately. At 646 meters, the city is high enough that summer afternoons are dry and intense, and winter mornings can be genuinely cold despite the city's southern latitude. The city's famous late dinners, often starting at 9 or 10 p.m., are a real cultural pattern rather than a stereotype, and they follow from a working day that still breaks for a long midday pause in many businesses.
The capital role also brings congestion and cost. Madrid's housing prices sit well above the national average, and the city's population swells on weekdays with commuters from the surrounding Community of Madrid. If you're planning a visit, the capital concentration means you can see the core of Spanish political and cultural life without leaving a compact central area.
How Madrid Became the Capital: The 1561 Decision and Its Consequences
The 1561 move is the single most consequential date in Madrid's history, and it is worth understanding what Philip II was actually doing. He was consolidating a court that had been peripatetic, and Madrid offered a central location with a palace and room to expand. The decision was not inevitable; Valladolid was a serious contender, and Toledo had a stronger claim as the seat of the Spanish Church.
The consequences unfolded over centuries. Madrid grew from a modest town into an imperial capital, and its population climbed steadily through the 16th and 17th centuries. The city's layout still reflects that growth: the historic center's tight streets and the grand Bourbon-era boulevards built in the 18th century sit side by side.
The 1601–1606 Valladolid interlude shows that capitals can move. Philip III's decision to relocate was reversed within five years, and the court returned to Madrid. That episode is the clearest evidence that Madrid's status, while now constitutional, was once contingent on royal preference.
For a reader trying to understand why Madrid rather than Toledo, the answer is that the crown chose administration over ecclesiastical prestige. The Spanish Church remained anchored in Toledo, and Madrid took on the secular functions of government. That split between religious and political authority is still visible today: Toledo's cathedral is the seat of the Primate of Spain, while Madrid holds the government.
Beyond the Capital: Spain's Regional Capitals and Former Courts
Spain is not a centralized state in the French sense, and its regional structure matters for anyone trying to understand what "capital" means there. The country is divided into 17 autonomous communities, each with its own capital and its own parliament. Madrid is the capital of both Spain and the Community of Madrid, which is one of those 17 communities.
Barcelona is the capital of Catalonia and the seat of the Catalan government, the Generalitat. Seville is the capital of Andalusia. Valencia, Bilbao, and Santiago de Compostela hold the same role for their respective communities. These cities have real political power, and regional capitals often rival Madrid in cultural weight.
The former court cities round out the picture. Toledo served as the court before 1561 and remains Spain's ecclesiastical center. Valladolid hosted the court for five years in the early 1600s and retains a strong historical identity as a former capital.
The practical takeaway for a visitor is that regional capitals are not lesser versions of Madrid. They are the seats of governments with genuine authority over regional affairs, and each has its own political and cultural life. Confusing Barcelona for Spain's capital is a factual error, but it is also a useful entry point into how Spain's multi-level government actually works.
Madrid's Population and Size in Figures
Numbers help ground the capital question. Madrid's municipal population was about 3.3 million in the INE's 2024 register, and the wider Community of Madrid, which includes the city and surrounding municipalities, held about 6.7 million. Those figures come from the padrón, the municipal register that Spain uses as its official population count.
The Community of Madrid is one of Spain's most densely populated regions, and the city's metropolitan area extends well beyond the community's boundaries into neighboring provinces. Commuter flows into Madrid are substantial, and the city's weekday population runs higher than its resident count.
Madrid's elevation of roughly 646 meters is another figure worth holding onto. It makes Madrid the highest capital city in the European Union, ahead of other elevated capitals like Luxembourg City. That elevation explains the city's climate and its dry, sunny character.
For comparison, Barcelona's municipal population was about 1.7 million in the same 2024 INE register, roughly half of Madrid's. Seville's was about 680,000. The gap between Madrid and the next-largest Spanish city is one reason the capital's cultural and political concentration is so pronounced.
Is Madrid the Capital of Spain or Just Its Biggest City?
Madrid is both. It is the constitutional capital and the largest city, which makes the question of whether it is "just" the biggest city a bit moot. The more useful distinction is between Madrid as a municipality, the Community of Madrid as a region, and Spain as a whole. Those are three different levels, and each has its own capital or seat of government.
The municipality of Madrid has its own mayor and city council, and the city is the capital of the Community of Madrid as well as of Spain. The Community of Madrid has its own parliament and government, seated in the city. Spain's national government sits in the same city.
That layering is a genuine source of confusion. When someone says "Madrid," they might mean the city, the region, or the metro area. When someone says "the capital of Spain," they mean the city, and the Constitution is the authority for that.
For a reader who wants a single mental model: Madrid is the national capital, Barcelona is the Catalan capital, Seville is the Andalusian capital, and Toledo is the historic ecclesiastical center. That four-way mapping covers most of the confusion people bring to the question.
Traveling to the Capital: What to Expect on the Ground
If you're heading to Madrid, capital status is why the city's center is packed with the institutions you'd want to see. The Royal Palace, the Prado, and the Congress of Deputies are all in or near the historic center, and the city's metro network connects them efficiently. Madrid's metro is one of the largest in Europe by route length, and a single ticket covers travel within the central zones.
The sensory experience of the city is distinctive. The Paseo del Prado smells of plane trees and hot stone in summer, and the terraces along the boulevard fill up late and stay full. Dinner at 10 p.m. is normal, and the city's nightlife runs well past midnight in the central neighborhoods. In winter, the same streets are cold and clear, and the city's Christmas lights along the major shopping streets are a genuine draw.
Practical details matter for a capital visit. Madrid's Barajas airport, officially Adolfo Suárez Madrid–Barajas, is the main international gateway, and it sits about 12 kilometers from the city center. The city's main train stations, Atocha and Chamartín, connect Madrid to the rest of Spain, with high-speed AVE services running to Barcelona, Seville, and Valencia.
If you're planning a trip around the capital question, build in time for the museums and the historic center rather than treating Madrid as a transit point. The capital role concentrates a lot into a compact area, and a two-day visit can cover the Prado, the Royal Palace, and the Plaza Mayor without rushing.
Common Mistakes People Make About Spain's Capital
The most common mistake is naming Barcelona. It is Spain's second city and its most internationally visible one, but it is not the capital. That error comes up often enough that it's worth stating plainly: Barcelona is the capital of Catalonia.
A second mistake is assuming the capital has always been Madrid. Before 1561, the court moved among cities, and Toledo and Valladolid both served as seats of government. Madrid's status is old but not eternal, and the 1601–1606 Valladolid interlude is the clearest proof.
A third mistake is confusing the city with the region. Madrid is both the city and the autonomous community, but they are separate administrative entities with separate governments. When someone says "the Community of Madrid," they mean the region, not the city.
A fourth mistake is treating capital status as a purely ceremonial fact. Spain's capital hosts the national government, the parliament, and the royal palace, and decisions made there affect the whole country. That concentration is why Madrid's politics and culture carry more weight than its population alone would suggest.
FAQ
Is Madrid the capital of Spain or Barcelona?
Madrid is the capital of Spain. Article 5 of the 1978 Constitution names Madrid as the capital of the State, and the city has held that role since 1561, with a five-year interruption from 1601 to 1606 when the court moved to Valladolid. Barcelona is the capital of Catalonia, not of Spain, and the two cities are often confused because Barcelona has higher international visibility.
Did Madrid ever lose its status as capital?
Yes, briefly. Philip III moved the court to Valladolid in 1601, and it returned to Madrid in 1606. That five-year gap is the only interruption since 1561, and it is the reason some historical accounts describe Madrid's capital status as continuous but not unbroken. No modern legal change has moved the capital since the 1978 Constitution took effect.
How does Madrid's elevation compare with other European capitals?
Madrid sits at roughly 646 meters above sea level, which makes it the highest capital city in the European Union. That elevation explains the city's dry summers and cold winter mornings, and it is a detail most short answers about the capital omit. Luxembourg City is the nearest high-capital comparison in the EU, but Madrid is higher.
Is Seville the capital of Spain?
No. Seville is the capital of Andalusia, one of Spain's 17 autonomous communities. It was a major trade gateway to the Americas in the 16th and 17th centuries, but it has never been the national capital. The confusion sometimes comes from Seville's historic prominence, which was commercial and maritime rather than political.
What is the difference between Madrid and the Community of Madrid?
Madrid is a municipality and the national capital. The Community of Madrid is the autonomous community that surrounds and includes the city, with its own parliament and government. The city is also the capital of the community, so the same name refers to two different administrative levels, which is a common source of confusion.
Do Spain's regional capitals have real political power?
Yes. Spain's 17 autonomous communities each have their own capital, parliament, and government, and regional capitals like Barcelona, Seville, and Valencia exercise genuine authority over regional affairs. That multi-level structure is why "capital of Spain" and "capital of Catalonia" are different questions with different answers.
How many people live in Madrid compared with Barcelona?
Madrid's municipal population was about 3.3 million in the INE's 2024 municipal register, and Barcelona's was about 1.7 million in the same count. The Community of Madrid, the wider region, held about 6.7 million residents. The gap between Madrid and Barcelona is one reason the capital's cultural and political concentration is so pronounced.
If I visit Spain, should I go to Madrid or Barcelona first?
It depends on what you want. Madrid is the political and institutional center, with the Prado, the Royal Palace, and the national government, and it rewards travelers interested in Spanish history and politics. Barcelona is the Catalan capital, with a distinct language, architecture, and coastal setting. If you only have time for one, Madrid answers the capital question directly; Barcelona answers a different one.