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 but failed to gain a majority with the leftist Ahora Madrid the runner-up. Manuela Carmena, mayoral candidate for the later, was proclaimed mayor after a deal was reached between her party and the PSOE. Madrid is administratively divided into 21 districts, which are further subdivided into 128 wards ("barrios") Madrid is the capital of the Community of Madrid. The region has its own legislature and it enjoys a wide range of competencies in areas such as social spending, healthcare, education. The seat of the regional parliament, the Assembly of Madrid is located at the district of Puente de Vallecas. The