in prehistoric times people lived in the area which is now madrid. the romans lived there for several centuries. the origin of today’s city really starts in the 9th century when muhammad i had a small palace built where the palacio real stands today. the moors built strong forts in madrid in 865 and put a wall round the city. these walls stood until 1476 when they were knocked down. in 1561 felipe i moved the royal court from toledo to madrid. madrid had now become the capital of a very large empire. over the next years and decades the plaza mayor was built and many great buildings and monuments, many of which still stand.