The municipalities of Spain (Spanish: municipios), 8112 in total including free cities of Ceuta and Melilla, are the basic level of Spanish local government. Each municipality forms part of a province (fifty in total, this time excluding Ceuta and Melilla), which in turn forms part or the whole of an autonomous community (seventeen in total plus Ceuta and Melilla): some autonomous communities have additional second level subdivisions, such as comarcas or mancomunidades. The average population of a municipality is about 5,300, but this figure masks a huge range: the most populous Spanish municipality is the city of Madrid, with a population of 3,016,788 (2002) , while several rural municipalities have fewer than ten inhabitants (e.g., Villarroya (La Rioja), population 11 in 2006). The area of the municipal territory (Spanish: término municipal) usually ranges from 2 to 40 km², although municipalities such as Tremp (Lleida) cover more than 400 km².
The organisation of the municipalities is governed by the Law of 2 April 1985, completed by the Royal Decree-Law of 18 April 1986. The Statutes of Autonomy of the various autonomous communities also contain provisions concerning the relations between the municipalities and the autonomous governments. In general, municipalities enjoy a large degree of autonomy in their local affairs: many of the functions of the comarcas and provinces are actually municipal powers which have been pooled together.
Each municipality is a corporation with independent legal personality: its governing body is called the ayuntamiento, a term which is often also used to refer to the municipal offices or "town hall". The ayuntamiento is composed of the mayor (Spanish: alcalde), the deputy mayors (Spanish: tenientes de alcalde) and the plenary assembly (pleno) of councillors (concejales). The mayor and the deputy mayors are elected by the plenary assembly, which is itself elected by universal suffrage on a list system every four years (next elections due in May 2011). The plenary assembly must meet at least once every three months, in public and at the seat of the ayuntamiento. Many ayuntamientos also have a governing commission (comisión de gobierno), named by the mayor from among the councillors, which is obligatory for municipalities of more than 5000 inhabitants. The governing commission, whose role is to assist the mayor between meetings of the plenary assembly, cannot include more than one-third of the councillors.
|Mayor||Alcalde||Alcalde or Batlle||Alcalde||Alkatea|
|Deputy Mayor||Teniente de alcalde||Tinent d'alcalde||Tenente de alcalde||Alkateordea|
|Comisión de gobierno||Comissió de govern||Comisión de goberno||Gobernu batzordea|