Madrid is governed by the City Council (*Ayuntamiento de Madrid*), which is headquartered in the Palacio de Cibeles. The council is headed by the Mayor, who is elected by the council members following municipal elections held every four years.
Administratively, the city is divided into 21 districts (*distritos*), such as Centro, Salamanca, Retiro, and Chamberí. These districts are further subdivided into 131 wards (*barrios*). Each district has its own municipal board (*Junta Municipal de Distrito*) which handles local administrative tasks and neighborhood services.
In addition to its municipal government, Madrid is the capital of the Community of Madrid (one of Spain's 17 autonomous communities) and the seat of the national government of Spain. Consequently, it hosts the Spanish Parliament (*Cortes Generales*), the official residence of the Prime Minister (Palacio de la Moncloa), and the official residence of the Spanish Royal Family (Zarzuela Palace).

