The foundation stone for the basic fortification was laid out in 1640. A year later, in January 1641, the fort saw its first battle, during the Catalan Revolt when the Principality of Catalonia challenged Spain's authority. On orders from the King of Spain, Pedro Fajardo, heading an army of 26,000 men, proceeded to crush the revolt. The Spanish recaptured several cities, but they were defeated at the Battle of Montjuïc by Catalan, led by Francesc de Tamarit.