Ourém is a town and municipality in central Portugal, near the city of Leiria. Ourem is mostly visited for its ruined castle and palace, which date back to the Moorish occupation that began in the eighth century. Ourem, then called Abdegas, was reclaimed by the Portuguese during the twelfth century Christian Reconquista and given the new name of Portus de Auren. Legend has it that the name Ourem was given to the town by Fatima, a Moorish princess who was kidnapped by a Christian knight. Fatima fell in love with her kidnapper and converted to Christianity, taking the new name of Oureana. She received the town as a prize and named it after herself.
During the remainder of the Reconquista the castle served as an important watchtower for the stronghold of Leira. The town grew up around the castle and flourished in the fifteenth century under the rule of Count Afonso, who remodelled the castle and built a palace inside it, influenced by the Italian military architecture that was fashionable at the time. Count Afonso died in 1460 and was buried in the church crypt, in a magnificent gothic tomb created by the famous fifteenth century Portuguese sculptor, Diogo Pires-o-Velho. Ourem began a steady decline after the death of Alfonso and was further damaged by the 1755 Lisbon earthquake and the Napoleonic invasions.
Ourem was known as Vila Nova de Ourem until 1991 when it was elevated to the status of a city.