With more history than territory, the Community of Madrid obviously centres on the capital of the State. The city plays the leading role; from the time of the Arab Magerit to the present-day Madrid, centuries of power and expansion have gone by, depply affecting the life of the territory.
The reconquest carried out in the year 1083 by Alfonso VI brought it once and for all into the territories wrested from Al-Andalus. Later councils were set up and it was given local privileges. During the reign of Charles I it supported the revolt of the 'comuneros', which failed after their defeat at the battle of Villarlar. Madrid did not become of major importance until Philip II moved his court there, making it capital of the country. From that time on, Madrid's history was parallel to that of Spain itself. In the 18th century, a period of splendour began in Madrid, culminating in the reign of Charles III. The rising of Esquilache, the Tumult of Aranjuez and the rising of the people of Madrid ushered in the War of Independence (Peninsular War) in the year 1808.