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.