Mafra is a municipality in the District of Lisboa, in the Lisbon Metropolitan Area, covering 291.66 km² and home to 86,521 inhabitants (2021 census). It was conquered from the Moors by D. Afonso Henriques in 1147 and donated in 1189 by D. Sancho I to Bishop D. Nicolau, who granted it its first royal charter the following year; D. Manuel granted a new royal charter in 1513. In 1717, D. João V laid the foundation stone of the Palácio Nacional de Mafra, a Baroque monument classified as a World Heritage Site. The municipality has 11 parishes (there were 17 between 1985 and 2013).