In Alcobaca in central Portugal, the first king of Portugal, Afonso Henriques, built a monastery, the Mosteiro de Santa Maria de Alcobaça, to commemorate the defeat of the Moors in 1147 AD. The city itself grew along the valleys of the rivers Alcoa and Baça.