The two towers flanking the entrance are located in the front right, with the ruins of the large palace of Count Afonso just behind them. The oldest portions of the castle are located in the back left of the image.
According to the legend, the town of Ourem owes it name to a love story: during the Reconquest, crusader, Gonzalo Hermingues, captured the daughter of a powerful Muslim king from Alacer do Sal. The ravishingly beautiful girl was called Fatima, just like Mahomet's daughter.
Gonzalo Hermingues and his captive soon fell in love, and Fatima willingly converted to Catholicism. She was baptised with the first name Ouranea (which gives the etymology of the town of Ourem) and they got married.
Fatima died in her prime. Gonzalo Hermingues was inconsolable and became a monk at the Cistercian abbey of Alcobaça, founded by Saint Bernard.
The abbey soon had a small priory in the surroundings, and Brother Hermingues was sent there. He quickly had the remains of his beloved Fatima brought to him; the place then took her name and is still called Fatima.