During the Christian reconquest of the peninsula, the town was taken by King Alfonso II (1211-1223) from the Moors in 1217. For its settlement and defense, the sovereign donated these domain to the Order of Aviz, encouraging the construction of the castle.
Because the region was in disputed territory with the Kingdom of Castile, under the reign of King Dinis (1279-1325), Borba definitely came into the possession of Portugal because of the signing of the Treaty of Alcanises in 1297. Due to its strategic importance, the king granted it a Foral charter in 1302, by which time he ordered the strengthening of defenses.
King Manuel I (1495-1521) confirmed the town's charter.
In the Portuguese Restoration War, the town acquired strategic importance on the border.
As noted with other defensive structures in Portugal, the expansion of the urban area from the nineteenth century led to the integration of the medieval walls in houses. In the mid-twentieth century, the IGESPAR branch of the national government classified the castle as a site of Public Interest by Decree published on 18 July 1957.