Although [...] present until 1147, when the area was taken by Afonso Henriques, remnants from the Moorish occupation are rare. There are suggestions that many of the churches were once mosques, such as the Matriz Church of Cheleiros, the Church of Santo André and the sanctuary of Serra do Socorro. The origin of the local toponymy "Mafra" is unclear, but evolved from variations of Mafara (1189), Malfora (1201) and, later, Mafora (1288). Some suggest its origin came from the Turanian "Great Ara", a female fertility cult that may have existed along the rim of the early village. Others suggest that it developed from the Arabic "Mahfara", which means "pit", which presumed that the location was implanted within a pit, a fact that was disproved by the Arabist David Lopes. The town is, in fact, located on a hill, with two ravines (Rio Gordo and Rio dos Couros) limiting the area around it.