The first record of the castle is a document from 998. The original castle was supposed to be just a tower, now gone, on top of the big rock. The current building is an aggregate of constructions from different periods. Its historical value comes, above all, from its role during the War of Succession, when on August 13 and 14, 1714, a month before the capitulation of Barcelona, ”The Battle of Talamanca” took place there , the last won by the Catalan army against the Bourbon troops.