The Community of Madrid ( , -eskomuniˈðað ðe maˈðɾiðIPA) is one of the seventeen autonomous communities of Spain. It is located at the center of the country, the Iberian Peninsula, and the Castilian Central Plateau (Meseta Central). The community is also conterminous with the province of Madrid and contains the capital of Spain, which is also the capital of the community. It is bounded to the south and east by Castile-La Mancha and to the north and west by Castile and León. It has a population of 6,369,167 (2011) mostly concentrated at the metropolitan area of Madrid.
The creation of the contemporary Community of Madrid was preceded by an intense political debate during the "pre-autonomic" period; that is, the period of political debate that led to the institution of autonomous communities as the first-level political divisions of Spain consisted of provinces, a political division that had existed since the 1833 territorial division of Spain. Autonomous communities were to be created by one or more provinces with a distinct regional identity; since Madrid was part of the historical region of Castile, assigned to New Castile in the 1833 provincial organization, it was first planned that the province of Madrid would be part of future community of Castile-La Mancha (which was roughly similar to New Castile, with the adding of the province of Albacete) but with some special considerations as the seat of government of the State. The integrating provinces of Castile-La Mancha opposed such a special status, and after considering other options-like its inclusion to the community of Castile and León or its constitution as an entity similar to a federal district-it was decided that the province of Madrid would become a single-province autonomous community by appealing to the 144th article of the constitution, whereby the Parliament can authorize the creation of an autonomous community, even if it did not satisfy the requirement of having a distinct historical identity, if it was the "nation's interest". Thus, in 1983, the Community of Madrid was constituted and a Statute of Autonomy was approved taking over all the competences of the old Diputación Provincial and the new ones the Statute considered.
The Town of Madrid (Spanish: ) was designated as the capital of the community as well as has been explicitly designated as the capital of the country by the 1978 Constitution. Nonetheless, several proposals have been made to make other towns the capital of the community like Alcalá de Henares, in the 1980s, and more recently, Getafe, without any relevance.