Origins
The Castle of Castellar forms part of the line of fortifications constructed during the 10th century for the reconquest. Forts were located in elevated sites overlooking rivers and streams whose valleys were the natural route to be taken to reach the more extensive, fertile plains where the towns were to be found. These fortifications had a two-fold objective: on the one hand, to prevent raids carried out by the Arabs on the flatlands of the Bages and Anoia regions; and on the other, to conquer the Calaf plateau and advance towards the Urgell.
By the 11th century Castellar had concluded its reconquest from the Moors and the region had been feudalised. This is known thanks to the will made by Seguí, Lord of Castellar, dated 1022. On his death and in addition to its area of influence, the Castle of Castellar encompassed dominion over the six watch towers that in turn gave rise to six fortified medieval settlements which have survived to this day: Les Coromines, El Seguer, Puigfarner, Vilallonga, Solanelles and La Guàrdia Pilosa. Between the first three of these and the castle was a watch tower perched atop a 700-metre-high hill which relayed communications between them and the castle: the Guardiola farmhouse, later renamed Cal Ribera. Thus the dominion of the Castellar family formed a wedge-shaped territory which extended from east to west, from the castle to La Guàrdia Pilosa, and which is today the municipality of Pujalt.
The reconquest was also visible in the spiritual terrain, as the Church always took part in the organisation of these new territories. All settlements that were established around the towers had their own church, almost all of which were subordinate to the diocese of Sant Miquel of Castellar (the castle church). Thus, the relationship between the three elements of the feudal world – the lord of the land, the Church and the peasantry – gradually became consolidated in the reconquered territories.