Following the ninth-century foundations of Mayrit
Follow the surviving Islamic fortifications below the Royal Palace and discover the hilltop settlement that existed long before Madrid became Spain’s capital.
📍
Cuesta de la Vega, Madrid, Spain
INTRODUCTION
Below Madrid's Royal Palace, a stretch of rough stonework runs through a small garden beside Cuesta de la Vega. Its square towers look very different from the grand buildings above. These are remains of the city's first defensive wall, raised when Madrid was a frontier settlement in Islamic al-Andalus.
The wall belongs to a Madrid that existed centuries before Philip II established his court here in 1561. The original fortress has gone, most of its enclosure has disappeared and later streets have altered the hillside. Yet this surviving section still gives the early town a measurable shape.
Begin with the stones, then follow the traces of the lost gates and the nearby archaeological collections. Together they explain why a fortified hill became a settlement, and how that settlement eventually grew into Spain's capital.
KEY HISTORICAL MOMENT
During the reign of Emir Muhammad I of Córdoba, between 852 and 886, a fortified enclosure was established on the hill overlooking the Manzanares valley. The stronghold helped defend the approaches to Toledo and control movement through the region. Around this military nucleus, the settlement known as Mayrit developed. Its defensive wall remains the most substantial surviving evidence of that beginning.
ORIGINS
Madrid's earliest Islamic stronghold occupied high ground near today's Royal Palace. From here, defenders could watch routes across the Manzanares valley. Toledo, a major centre of al-Andalus, lay to the south, while Christian rulers contested lands farther north.
The fortification did more than resist attacks. It housed a garrison, offered a place to observe passing traffic and provided a focus for administration. It belonged to a network of regional routes.
Muhammad I is traditionally credited with establishing Madrid as a fortified settlement in the ninth century. Archaeologists distinguish this early Islamic nucleus from evidence of earlier activity in the surrounding area. The surviving wall belongs to the new defensive enclosure, not to a Roman city wall.
Inside the defences stood a fortress, or alcázar, and an enclosed settlement often called the almudaina. The hill's later transformation makes the original buildings difficult to recognise, but the wall fixes one edge of the area they occupied.
THE FIRST ENCLOSURE
The builders used flint and limestone, materials that remain easy to distinguish in parts of the surviving masonry. Lower courses of flint support sections of cut limestone, with lime mortar binding the stones. The arrangement reflects building methods used for military architecture in Islamic Córdoba.
Square projecting towers punctuated the line. They gave defenders positions from which to observe and protect sections of wall that would otherwise have been vulnerable. Today's surviving remains include several of these towers, although the upper fighting platform and any battlements cannot be read as a complete medieval structure.
The enclosure followed the uneven land rather than a perfect geometric plan. Its western side faced the valley, while other stretches bounded the inhabited hill. Gates controlled the places where a traveller could pass from the roads into the fortified centre.
Modern Madrid covers most of that route. To picture its course, imagine the surviving wall continuing beneath later streets and buildings towards the palace site. The masonry in the park is an original fragment of a much larger circuit, not a reconstruction of the entire fortress.
ACROSS CENTURIES
Madrid came under Castilian rule in the late eleventh century, during the expansion associated with Alfonso VI. Growth pushed beyond its first enclosure. Between the late eleventh and thirteenth centuries, a larger defensive circuit arose, partly reusing stone from the Islamic walls.
The Arab Wall beside Cuesta de la Vega belongs to the first, smaller town. Remains of the later Christian wall appear elsewhere, sometimes embedded in buildings in the historic centre.
As Madrid changed, medieval walls became convenient building material and foundations. Along Cuesta de la Vega, parts of the Islamic wall survived because later palaces, including Castro Serna and Malpica, incorporated it into their supporting structures. Much of what remained was concealed from public view.
Those palaces were demolished in the 1970s. The wall gained national monument protection in 1954, although damage still occurred. Later conservation stabilised its masonry and distinguished medieval remains from repairs.
The park opened in 2010. Later works exposed traces near Puerta de la Vega, improved access and added interpretation panels. The garden is modern; the central stones are medieval.
INTERESTING FACTS
Accounts of the first enclosure identify three gates: Puerta de la Vega to the west, Puerta de Santa María to the east and Puerta de la Sagra to the north. None survives as a standing medieval gateway. Their names help explain how the early settlement connected with different routes beyond its defences.
The original fortified precinct covered roughly four hectares, a small area compared with central Madrid today. This figure includes the military and settled parts of the hill. It also explains why the Royal Palace district occupies such a prominent place in accounts of the city's beginnings: the first nucleus was concentrated there. Its footprint was far smaller than the districts that spread beyond the walls.
Excavations around Cava Baja and Plaza de los Carros have revealed evidence of an Islamic-period suburb beyond the defensive circuit. Finds from this area, as well as from Cuesta de la Vega and Plaza de la Armería, are associated with the Museum of San Isidro. Mayrit was more than a military outpost.
A model installed near the wall in 2010 places the Islamic and later Castilian enclosures over a plan of modern streets. Its lines are interpretative reconstructions, not a claim that every buried section has been excavated. Comparing the two circuits makes the medieval growth of Madrid unusually easy to grasp.
WHAT TO SEE & DO
Begin on Calle de Bailén by the Royal Palace and Plaza de la Armería. This was the area of the early fortified nucleus, although the buildings here are much later. The present palace replaced a royal alcázar destroyed by fire in 1734.
Notice the ground itself: it falls towards the Manzanares. Then head towards Cuesta de la Vega. The view explains the strategic choice of this hill even though the ninth-century fortress no longer stands above ground.
At the archaeological park's upper area, look for remains associated with Puerta de la Vega, the enclosure's western entrance. Municipal excavations uncovered foundations and presented them for visitors. These are low fragments and ground traces, not an intact gateway.
Use the site information to place the gateway relative to the wall. It controlled passage between the fortified hill and the road descending towards the river. Access depends on the park's opening arrangements.
Continue to the long section inside Parque Emir Mohamed I. Stand back to follow the wall's course and pick out its square towers. The surviving stretch runs for approximately 120 metres, showing how the defences worked beyond a single isolated fragment.
Compare stone sizes and repairs without touching or climbing the structure. Notice how towers project from the wall's face. Different layers of masonry also let you identify flint and limestone within the same monument.
Walk to the Museo de San Isidro at Plaza de San Andrés. Its displays cover Madrid before the court arrived, including archaeological evidence of the Islamic settlement. Excavated objects help replace vanished buildings with traces of everyday life.
After the wall's military architecture, the museum puts Mayrit within a wider inhabited town. Check the permanent displays and ask about temporarily closed sections of its archaeological store.
WHY VISIT?
Madrid is usually introduced through royal palaces, Habsburg squares and the museums of a great European capital. The Arab Wall reverses that order. Here, the first question is not what the monarchy built, but why a fortified community occupied this hillside centuries earlier.
It is a particularly rewarding stop for travellers who enjoy archaeology, city maps and the relationship between streets and terrain. The surviving wall is modest compared with the palace above, but the contrast makes its significance clearer. Pair it with the Museum of San Isidro and the Travel4History guide to Madrid for a broader historical walk.
PRACTICAL INFORMATION
The remains stand in Parque Emir Mohamed I on Cuesta de la Vega, below Almudena Cathedral and near the Royal Palace. Ópera station is a useful starting point; La Latina suits a combined visit with the Museum of San Isidro.
Madrid City Council lists the park's opening hours as 10:00–21:00 on weekends and public holidays, without regular weekday entry in that schedule. The wall's surroundings can be seen from public streets, but consult the official park page before entering the garden.
The Museum of San Isidro is free. Published hours are Tuesday to Sunday, 10:00–20:00, or 10:00–19:00 from 15 June to 15 September. It closes Mondays and selected holidays. Check its website for exceptional closures.
The Royal Collections Gallery near Plaza de la Armería includes a ninth-century wall section uncovered during construction. This is a separate ticketed museum visit, not part of the outdoor wall route. Check its visitor information if you would like to compare the two surviving fragments.
Allow about 30–45 minutes for the wall, model and surroundings if the park is accessible. Add approximately an hour for the museum and time to walk between sites. These are editorial estimates, not official tour durations.
The council describes the park as partly accessible, with most principal paths usable by visitors with reduced mobility. Nearby streets slope and paving can be uneven. View the protected wall from designated paths; do not climb or touch the stones.
Location
Cuesta de la Vega, central Madrid
Site type
Ninth-century Islamic city wall
Early founder
Emir Muhammad I of Córdoba
Origins
Mid-ninth century
Original enclosure
Approximately four hectares
Surviving section
About 120 metres
Nearby museum
Museo de San Isidro
Suggested visit
30–45 minutes; longer with museum
Plan a visit to Madrid’s first fortifications and connect the wall with the city’s older streets and archaeological collections.
EXPLORE MORE
Continue exploring Madrid’s oldest quarters, from the surviving traces of its Islamic origins to royal landmarks, medieval streets and traditional neighbourhoods.
Visit the cathedral beside Madrid’s oldest historic core, where the city’s medieval origins and later royal history meet.
Trace the transformation of Madrid’s early fortified settlement into a royal capital at the palace built on the site of the former Alcázar.
Explore one of Madrid’s most atmospheric historic squares, surrounded by buildings that reveal the city’s medieval and early modern past.
Wander through the winding streets of old Madrid and discover a neighbourhood known for its long history, lively squares and traditional street market.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent may affect certain features and functions.