In 1178, Ferdinand II of León donated the Ponferrada city to the Templar order for protecting the pilgrims on the Way of St. James who passed through El Bierzo in their road to Santiago de Compostela. Their castle was originally a hill-fort and later a Roman citadel. Templar knights took possession of the fortress and reinforced and extended it to use it as an inhabitable palace.
However, the Templars were only able to enjoy the use of their fortress for about twenty years before the order was disbanded and its properties confiscated in 1311. Several noble houses fought over the assets until Alfonso XI allotted them to the Count of Lemos in 1340. Finally the Catholic Monarchs incorporated Ponferrada and its castle into the Crown in 1486. Most of the walls were removed and used in local construction projects.
The building has an irregular square plan and the outstanding features are, above all, the entrance which involves crossing the moat on a drawbridge and, further on, two large towers with crenellations joined by an arch. Its twelve original towers reproduced the shapes of the constellations.
References:The Walls of Constantinople are a series of defensive stone walls that have surrounded and protected the city of Constantinople (today Istanbul) since its founding as the new capital of the Roman Empire by Constantine the Great. With numerous additions and modifications during their history, they were the last great fortification system of antiquity, and one of the most complex and elaborate systems ever built. They were also the largest and strongest fortification in both the ancient and medieval world.
Initially built by Constantine the Great, the walls surrounded the new city on all sides, protecting it against attack from both sea and land. As the city grew, the famous double line of the Theodosian Walls was built in the 5th century. Although the other sections of the walls were less elaborate, they were, when well-manned, almost impregnable for any medieval besieger.