The territory of the Republic of San Marino is divided into nine Municipalities (Castelli) or administrative districts:
- Città di San Marino
- Borgo Maggiore
Each Municipality is governed by a Council. The Municipal Councils are decentralized administrative organisms, the origins of which are found in the Castles which were aggregated to the Republic in 1463 after the war against the Malatesta of Rimini.
Today the Councils are present in all nine Municipalities; they are elected by popular vote every four years and are composed of 21 members for the districts with more than 2000 inhabitants and 15 members for smaller districts. Each Council has its own Captain (Capitano di Castello) who remains in office for two years.