As known, the splendour of feudal lords was directly linked to the name and the importance of the towns and villages they had under his domain. During the thirteenth century, the barons of Mataplana edited granted letters to the population, including the one of Castellar de n'Hug, 1292. That’s how he ensured the attraction of people towards their domains.
The situation of the castle of Castellar was quite strategic because it was at the entrance to his land.
In order to have people who would live and protect the region, Ramón de Urtx edited a granted a town charter.
The last reference of the castle is dated in the year 1482, when Galceran de Pinos sent a note to the people from Castellar telling them to stay locked up inside the castle walls that awaiting a possible attack . Gradually, the fort lost its importance but the number of habitants kept on growing.
Castellar de n'Hug has maintained the traditional structure and construction of their homes, streets and squares, forming an admirable architectural ensemble.