It seems that the name “Hostalric” can be traced back to a hostel that already existed in the 11th century, although the earliest mention of the town’s name dates from 1106 and the earliest reference to the castle is from 1145.
In 1242 James I the Conqueror granted a licence to the Viscount of Cabrera to hold a weekly market in the town. One year later, the town obtained a letter of settlement aimed at encouraging the creation of a stable population centre around the castle.
Bernat I of Cabrera ordered the building of the town’s first walled enclosure and, together with his descendants, was responsible for turning Hostalric into the administrative capital of the viscounty’s extensive lands.
Hostalric was affected by the feudal battles of this period. In 1462, the War of the Remences (a peasant revolt) left its mark when Hostalric’s inhabitants refused to open the town gates to the troops of the Council of the Principality, who cut down vines, destroyed corn fields and threatened to enter the walled enclosure.
It was consequently decided to modernise the town’s fortifications and the first field fortifications were completed during the Reapers’ War. Earth ramparts and brushwood defences were installed to protect the castle and mediaeval walls.
The War of the Spanish Succession triggered the building of permanent fortifications designed to make Hostalric Castle – Fortress a key defence element of the troops of Archduke Charles of Austria in Catalonia.
Hostalric played a brilliant role in the Peninsular War, helping to get supplies through during the Siege of Girona and hindering the progress of the enemy troops. That’s why it was so important for the French to take the town.
The town was sacked and set ablaze on 7 November 1809 by an army of 4,000 men. The French razed the entire town to the ground and its inhabitants were forced to flee to neighbouring towns. In January 1810 the French took the town and the long siege of the castle began. Four months and over 4,000 bombs later, Colonel Estrada and the surviving members of the garrison tried to save themselves by fleeing the fortress and fighting their way through the enemy. The fortress was taken by the French the next day.
The Captain General of Catalonia awarded a gold medal to the garrison officers and a silver one to the troops. The inscription read: “Constant bravery and loyalty, Hostalric 12 May 1810”.
Other important events that occurred in the 19th century were the expropriation of the Convent of the Minims in 1835 as a result of the ecclesiastical confiscations of Mendizábal, the arrival of the Carmelite Sisters of Charity, who took over the running of the old hospital and a girls’ school in 1856, the arrival of the steam train in 1860, the literary festival in honour of Frederic Soler Pitarra in 1887, the installation of electricity in 1895 and the construction of the Llensa cork factory.
The parish church was burned down at the start of the Spanish Civil War but the town was not bombed. During this period, the castle served as a fuel and munitions store for the Republicans. After the war it functioned as a shelter and accommodation for many people passing through. In 1939, the local council ordered all the signs written in Catalan to be changed. Joan Guitart i Roca, nicknamed “Sanxo”, served as mayor of the town from 1937 to 1939, when he was called up to fight. In July of the same year he was shot by Francoists in Girona.
In 1949 the Spanish government sold the abandoned castle to Hostalric Town Council for 18,500 pesetas. Restoration works began in 1967 in order to turn it into a restaurant. The complex comprising the walls and the castle was declared an Asset of National Interest in 1963.