The Castle of Óbidos (Portuguese: Castelo de Óbidos) is a well-preserved medieval castle located in the civil parish of Santa Maria, São Pedro e Sobral da Lagoa, in the municipality of Óbidos, Portuguese District of Leiria.
Óbidos had its foundation in the existence of a fortified settlement, likely over the Luso-Roman castro and Roman oppidum (then civitas) on the hilltop, that was the mysterious Eburobrittium, once cited by Pliny the Elder as being situated between Collipo (present-day Golpilheira near Leiria) and Olisipo (Lisbon). Archeological surveys later resulted in the discovery of a forum, baths and other Roman structures near the settlement. The area was later settled by the Lusitanos (since the 4th century BC) and Romans in the first century, but later occupied by Visigoths during the 5th and 6th century and Muslims, who were responsible for fortifying the town in the 8th century.
During the Christian Reconquista, forces under the first Portuguese king Afonso I (1112–1185) defeated the settlement's defenses through a ruse, on 10 January 1148. The first surveys of the castle were undertaken in 1153, although the castle was never completely conquered until the reign of King D. Sancho I (in 1195), as documented in the epigraph Torre do Facho. Also at this time, the Albarra tower was converted into a jail, when the walls were reformulated by King Sancho I. The old dungeon was restored and expanded by King D. Denis, while the barbicans alongside the main gate was constructed.
Sancho's son and successor, King D. Afonso II (1211–23), donated the settlement and its castle to his wife, D. Urraca (in 1210). The settlement and castle maintained their loyalty to King D. Sancho II (1223–48), during the crisis, resisting victoriously the assaults of forces loyal to the Count of Bologna, future King D. Afonso III (1248–1279). This resistance resulted in the epitaph of mui nobre e sempre leal (very noble and ever loyal), that figured into the municipal coat-of-arms.
The settlement progressively expanded from this point, followed by the fortifications, integrating such structures as the Torre Atalaia (situated in the south). Donated as a wedding gift to D. Denis (1279–1325) and Queen Elizabeth during their stay, the town began to figure into the property/possessions of all successive Queens of Portugal as of 1834. The dungeons were later expanded and the keep tower ( the Torre de D. Fernando or D. Fernando Tower) constructed by the Queen. As part of the construction, a connection was made between the dungeons and the Church of Santiago gallery.
During the context of the 1383–1385 Portuguese succession crises, the alcaide (against the wishes of its residents) allied with John I of Castile, resulting in an assault by the forces loyal to the Master of Avis (future King John). Óbidos and its castle were transferred to John (following his election by the Cortes in Coimbra as King) by Vasco Gonçalves Teixeira, following the death of his father and former-alcaide, João Gonçalves, in the Battle of Aljubarrota.
A settlement started building to the west and southern part of the castle within the walls sometime in the 15th century. During the reign of King D. John II (1481–1495), Queen Leonor selected the settlement and castle to reside following the death of her son, the Infante D. Afonso, opting for the thermal waters of the region for treatments necessary during her later life. King John II's successor, Manuel I donated to the town a foral in 1513, resulting in improvements to both the town and castle. During this phase, the Paços do Alcaide (Palace of the Mayor) was reconstructed, by then alcaide D. João de Noronha. The alcaide also worked on improving the walls.
During the 1755 Lisbon earthquake the castle suffered structural damage.
During the context of the Peninsular War, the fortification in Óbidos fired the first artillery rounds in the Battle of Roliça (1808) that resulted in the first defeat of Napoleonic forces. In 1842, the Albarrã tower was transformed into a clocktower. Construction on an exterior staircase access to the D. Fernando Tower occurred in 1869.
From 1932, the town saw the first interventions of consolidation, reconstruction and restoration by the Direcção-Geral dos Edifícios e Monumentos Nacionais (Directorate-General for National Monuments and Buildings). But, after many years of abandon, in 1948, the castle was transformed into a pousada, under a project developed by João Filipe Vaz Martins. The castle and the entire urban area of Óbidos are reclassified as a National Monument by governmental decree published on 5 January 1951. It took two years to concluded the adaptation of the medieval structure into a tourist pousada, by the Direcção dos Serviços dos Monumentos Nacionais (Directorate for the National Monument Services). The spaces were decorated in order to transform it into the Pousada do Castelo, with many of the furniture designed by architects Fernando Augusto Peres de Guimarães andLuís Benavente, with the collaboration made by Leonardo Castro Freire. The Comissão para a Aquisição de Mobiliário (Furniture Acquisition Commission) was charged with acquiring furniture provided by the Fábrica de Móveis Aséta (in Porto), under concession of Paola Luísa Maria Oliva (Luísa Satanela).