Ramon Malars was the lord of Vilobí Castle in 1337, when he had a capbreu (inventory of his domain) drawn up. This extensive parchment listed the characteristics of each possession and the corresponding rents and dues of its tenants.
There is nothing particularly special about this circumstance in itself but it is extraordinary that the capbreu of this feudal lord should still be preserved in the castle after almost seven centuries. It is unusual enough to find a mediaeval castle which is still used as a residence, as is the case of Vilobí, but to find one that also preserves its original inventory of rents and possessions is unique.
The castle dates back to at least the 13th century and had many owners (Malars, Sanmartí, Cruïlles and Sarriera families, etc.). In the 18th century its chapel became the present-day parish church, and in the 19th and 20th centuries several alterations were carried out. The fortified walls and mediaeval towers can be made out behind these alterations. Inside the castle, many walls and rooms are essentially the same as they were when Ramon Malars had the inventory of his domain drawn up in 1337.