It is located in the parish of Alcobaça, city and municipality of the same name, in the district of Leiria, Central Portugal
 
Local legends attribute the construction of the primitive castle to the Visigoths, but others attribute its construction to the Muslims who built it in a dominant position over the town named Alcácer-bem-el Abbaci, which was the name of a port city in Morocco.

At the time of the Christian Reconquest of the Iberian Peninsula, the lands in the Alcobaça region were taken by the forces of D. Afonso Henriques (1112-1185) around 1148, when they conquered the castle.

In the medieval period, the municipality was profoundly marked by the presence of the Cistercian Order, after D. Afonso Henriques (1109-1185) conquered its lands from the Muslims around 1148, donating them to that Order in 1153 (year of foundation of the Monastery of Santa Maria de Alcobaça) constituting the "Coutos de Alcobaça" added by royal donations and other faithful.

The region was attacked by the Moors (1191-1195) and Sancho I of Portugal (1185-1211) conquered the town and its lands, returning them to the Cistercian monks.

The castle was rebuilt by the Order and became part of an advanced line of defense of Lisbon, which included Leiria Castle, Pombal Castle and Óbidos Castle.

In 1369, the abbot of Alcobaça, D. Frei João de Ornelas, reinforced the castle's defense by erecting a barbican and also rebuilding a fallen tower and the section of walls facing the Monastery.

In the 15th century, under the reign of João I of Portugal (1357-1433), the castle was damaged by the 1422 earthquake and the necessary repairs were provided in 1424 (tower and walls).

In the context of the Philippine Dynasty, new repair works took place in the castle (1627), a prominent tower to the east began to be used as a prison until the 1755 earthquake in which it was destroyed.

In the first half of the 19th century, during the reign of Maria II of Portugal (1826-1828; 1834-1853), which no longer had a strategic or defensive function, the castle came into the possession of the Municipal Council of Alcobaça, using it as a quarry for new construction in Alcobaça and was considered extinct in the Minutes of the Municipal Council (1854).

In the middle of the 20th century, the abandoned castle began to use its cistern to store drinking water to be distributed to the population (1940).

Years later, partial reconstruction of the wall facing the Monastery took place, as well as cleaning work on the monument and its surrounding area on the occasion of Queen Elizabeth II of the United Kingdom's visit to Portugal when she visited Alcobaça (1956), but new repairs were carried out in 1965.

The archaeological excavations carried out on its premises in a four-year project started in August 2002 with municipal funds sought to elucidate questions relating to the time and authorship of the castle's foundation.

The work was coordinated by archaeologists Jorge António and Manuela Pereira, led by a group of volunteers and some local authority workers.

The Castle of Alcobaça (ruins) with a height of 69 meters, has an irregular organic plan in the Romanesque and Gothic styles, the walls of the first fence in limestone stonework still remain, reinforced by seven cubes with a quadrangular plan and another tower highlighted on the west side (keep) facing the Monastery.

To the east, a tower rises between the inner enclosure and the barbican with an oval plan reinforced on the west side by four cubes (two semicircular in plan).
The Classification of Alcobaça Castle (ruins)
 
The Alcobaça Castle (ruins) was classified as a Property of Public Interest on September 12, 1978.