At the time of the Christian Reconquest of the Iberian Peninsula, was first conquered by the forces of King D. Afonso Henriques (1112-1185) in 1159, to be abandoned four months later. It was retaken by surprise by an expedition of populars from Santarém, in early December 1162.
The first restoration of the walls of Beja dates from the reign of King D. Afonso III (1248-79), which made ??them start from 1253, with funds for ten years, two thirds of the tithes of the churches of Beja. The following year (1254), the town received its charter in the same terms of Santarém, confirmed in 1291 during the reign of his son, D. Dinis (1279-1325). By his orders it continued the rebuilding, strengthening and expanding the walls and towers (1307) and began the construction of the keep (1310).
The village and its castle supported the Master of Avis in the context of the crisis of 1383-1385, having involvement with subsequent episodes of the History of Portugal, as the phase of Discovery's.
Till the seventeenth century, the Castle of Beja was the subject of several expansions and upgrades, particularly in the context of the War of Restoration of Portuguese independence, when it was reinforced by bastions.
More than a century later, part of its walls were demolished and its stone used in building the new church of the former Jesuit College, the seat of the Bishop's Palace (1790).
In the early nineteenth century, with the outbreak of the Peninsular War, the city of Beja oppose serious resistance to the invading forces of Napoleon. As a result, the forces under the command of General Jean-Andoche Junot, killed about 1,200 people in the region (1808).
In the twentieth century was declared as a National Monument on June 16, 1910. From 1938 begins the repair actions by the Directorate-General for National Buildings and Monuments (DGEMN).
-- Source