Long before it became one of Europe's great capitals, the site of present-day Madrid was occupied by far older civilizations. Archaeological evidence traces human presence there to prehistoric times, with remains of the Celtic Carpetani people, Roman villas, a Visigoth basilica near what is now the church of Santa María de la Almudena, and three Visigoth necropolises near the areas known as Casa de Campo, Tetuán, and Vicálvaro. The city that would eventually grow from this ancient site owes its earliest identifiable urban form to the Emirate of Córdoba, which established a walled military outpost there in the late ninth century — a fortification intended to protect Toledo from Christian raids descending from the north.
The origin of the city's name remains a matter of scholarly debate. Several theories compete for acceptance. The most widely supported in recent decades is a Latin derivation: Madrid from Matrice, itself from Matrix — a reference to a water channel. Others trace the name to an Arabic root, maǧrā or majrīṭ, meaning water stream, spring, or fountain, reflecting the importance of water management to the settlement's early life. A Mozarabic variant connecting the same Latin root has also been proposed. Whatever its etymological source, the name has carried the identity of one of the world's great cities for more than a millennium.
Conquered by Christian forces in 1083 or 1085, Madrid grew steadily through the Late Middle Ages as a town of the Crown of Castile, though it remained distinctly secondary to Toledo and other established urban centers. The transformation of its status came in 1561, when King Philip II made the fateful decision to establish the permanent seat of the Spanish royal court there. The reasons were partly geographical — Madrid's position near the center of the Iberian Peninsula made it a practical hub for administering an empire that stretched from the Americas to Southeast Asia — and partly dynastic. The choice proved durable. Unlike many royal courts that moved with seasonal regularity, the Hispanic Monarchy's decision to anchor itself in Madrid set in motion centuries of urban growth, administrative concentration, and cultural accumulation.
The subsequent centuries saw Madrid evolve from a middling Castilian town into a metropolis of European significance. The construction of palaces, churches, convents, and public spaces reshaped its physical character. The Plaza Mayor, one of the most architecturally unified public spaces in Spain, was completed in the early seventeenth century and served as the center of civic and ceremonial life. The Royal Palace of Madrid, rebuilt after a fire destroyed the old Alcázar in 1734, became one of the grandest royal residences on the continent. The Buen Retiro Park was founded in 1631 as a royal pleasure ground and eventually opened to the public, becoming the green heart of the city. The Royal Theatre, with its restored opera house dating to 1850, anchors the city's musical heritage.
Today Madrid is the capital and most populous city of Spain, with a population of over 3.4 million in the city proper as of 2025, and a metropolitan area of approximately 6.8 million people. It is the second-largest city in the European Union after Berlin, and its metropolitan area is the second-largest in the EU after Paris. The municipality covers an area of 605.77 square kilometers and sits on the River Manzanares in the central Iberian Peninsula at an elevation of roughly 660 meters above sea level — making it the highest-altitude capital city in the European Union.
The city's economic weight matches its political centrality. The Madrid urban agglomeration generates the second-largest GDP in the EU. It hosts the headquarters of major Spanish corporations, including Telefónica, the airline Iberia, the banking giant BBVA, and the construction and services firm FCC. The bulk of Spain's banking operations are concentrated there, and Madrid ranks as an alpha world city by the Globalization and World Cities Research Network. The city also serves as the headquarters of several important international organizations, including UN Tourism, the Ibero-American General Secretariat, and the Organization of Ibero-American States.
Culturally, Madrid is anchored by an extraordinary concentration of world-class museums along the Paseo del Prado. The Prado Museum, housing one of the finest collections of European painting in existence, the Reina Sofía Museum of modern art — home to Picasso's Guernica — and the Thyssen-Bornemisza Museum together form what UNESCO has designated the Golden Triangle of Art, a cluster without parallel in most European cities. The city is also the seat of the Royal Spanish Academy, the institution that has long served as the authoritative standard-bearer for the Spanish language.
Football is woven into the city's identity as deeply as any cultural monument. Real Madrid and Atlético Madrid, both based in the city, are among the most successful and widely supported clubs in the world. Tourism draws millions annually — in 2023 alone, Madrid welcomed 5,757,815 international visitors, making it the second-most visited destination in Spain. Its major source markets include the United States, Italy, France, the United Kingdom, and Mexico. The city's mayor, as of the time of writing, is José Luis Martínez-Almeida of the People's Party. From its ninth-century origins as a military watchtower, Madrid has traveled an extraordinary distance to become one of the defining capitals of the modern world.

