The Catalans entered the war in 1705 when most of Catalan society came out in favour of the Austrian side. The conflict raged in Catalonia until 11 September 1714, when the troops of Philip V finally broke down the last Austrian resistance and captured Barcelona.
On 2 April 1706 the combined French fleet and Bourbon army already stood at the gates of Barcelona. Initially, they decided to seize the strategic point of Montjuïc but were surprised by an attack from the city and forced to retreat. The fighting and bombardment intensified until the castle was practically left in ruins, which resulted in its evacuation and subsequent occupation by the Bourbon troops, who used it to intensify the siege of the city. However, the arrival of an allied fleet reversed the situation and the Bourbon army was forced to withdraw. The central strategic position of the castle had become very clear and its reconstruction began immediately, with the strengthening of the west and east bastions and new communication routes to the city. The war continued until the new siege by the Bourbon troops ended on 11 September 1714. They occupied the castle on the following day.
The implementation of the Decret de Nova Planta (1716), legislation which defined the foundations of a new political order, also laid the basis of the city’s new defence system: with two citadels, one in what is now the Parc de Ciutadella and the other on Montjuïc. Control of Barcelona would be maintained from inside the city through the Ciutadella, and from the outside by completely remodelling Montjuïc Castle. In 1745, the military engineer Pròsper de Verboom, who was the mind behind the project for the Ciutadella, submitted a report on the fortresses of Catalonia in which he highlighted the shortcomings of Montjuïc Castle and the need to make improvements to its defences. This was the first time a proposal for planned modifications to the castle had been made, as previous work had always been improvised to a certain extent. The reconstruction of the castle took place under the command of Captain General Miguel Jaime Guzman, Marquis de La Mina, almost at the same time as the construction of the Castle of Sant Ferran in Figueres. The military engineer Juan Martín Cermeño designed both projects.
Planning was completed in 1751 and work began in 1753. The new fortress acquired its current aspect, with an irregular trapezoidal layout adapted to the lie of the land on the hill, and reinforced with four bastions at the extremes, while retaining the Velasco Bastion and improving the Llengua de Serp Bastion, which was shielded by new seaward and landward lunettes. The former Santa Isabel Bastion was enlarged by adding a new right flank and its name was changed to Santa Amàlia, while a new one, the Sant Carles Bastion was built from scratch. This was linked to the Santa Amàlia bastion by a new curtain wall, with an entrance and two guardhouses in the middle, and a combined fixed bridge and drawbridge spanning the moat. The glacis on the facade was extended and finally finished in 1779. The inside, reached by two ramps, was organized into two platforms with the higher building protected by a hornwork and ravelin. In addition, a cistern was built to collect non-potable water from off the slope of the hill beside the curtain wall that joined the Velasco and the Llengua de Serp bastions. Another cistern next to the main building supplied drinking water.
Work was completed in mid 1799, though improvements, repairs and maintenance have been a constant since then. The castle served as a prison during the War of the Pyrenees (1793-1795) and in 1808 it was occupied by Napoleon's troops.