This is the main fortification of the Castellciutat defensive system. The site was built on the remains of the old castle of the Counts of Urgell. Construction began in 1692, during which it was necessary to move the village of Castellciutat to its present location.
The continued clashes between the kingdoms of France and Spain, as well as the capture of La Seu d’Urgell by the French, led to the reinforcement of the frontier defences, and the hill of Castellciutat was one of the most suitable places.
The fortress complex originally had four bastions, advanced lunettes, barracks, warehouses and a chapel. At the time, it was a well-placed fortress and an important reference point during the War of the Spanish Succession. General Josep Moragues was the military Governor and was forced to surrender in 1713 to the Bourbon troops.
The complex also saw action during the Great War of 1794, and was later attacked by the Napoleonic forces, was besieged again in 1822 and once again, in 1875, when Government forces attacked the Carlists who had sheltered in the fortress. Today the ancient structures form part of a hotel complex.