The municipality of Castel San Pietro is located in the district of Mendrisio. It covers much of the land below Monte Generoso, including the summit station of the Monte Generoso Railway, but not the mountain summit itself, which is in the municipality of Rovio. The municipality consists of the village of Castel San Pietro, which is made up of the sections of Corteglia, Gorla, Loverciano, Obino as well as others. Since 2004, the former municipalities of Casima and Monte as well as the settlement of Campora (formerly part of the municipality of Caneggio) have been part of Castel San Pietro.