History of Madrid "Madrid" evolved from the Mozarabic "Matrit", which is still in the Madrilenian gentilic. The site of modern-day Madrid has been controlled since prehistoric times, and archaeological research found a small Visigothic village nearby. In the mid-9th century, Muhammad I of Córdoba constructed a small castle where the Palacio Real stands today. The Moors built a citadel, al-Mudayna, around this castle. They named the area after the nearby Manzanares River, which the Muslims called al-Majrīṭ (Arabic: "source of water"). From this came the name "Majerit", later spelled "Madrid". The Moors controlled the citadel until Alfonso VI of León and Castile conquered
Madrid the kingdom of Castile as a property of the Crown. Christians replaced Muslims in the occupation of the centre of the city, while Muslims and Jews settled in the suburbs. The city was thriving and was given the title of "Villa", whose administrative district extended from the Jarama in the east to the river Guadarrama in the west. The government of the town was vested to the neighbouring of Madrid since 1346, when king Alfonso XI of Castile implements the regiment, for which only the local oligarchy was taking sides in city decisions. Since 1188, Madrid won the right to