The population was under ‘behetría’, which was a regime where the people had the right to choose their lord. Throughout the centuries they fought in order to protect it from the usurpers that tried to submit them under a lordship regime, like the Manrique, that finally got to submit them and annex the territory to the County of Castañeda.
These fights lead to the so called Pleito de los Valles. They fought for their freedom, which was not recognised until the very end of the 18th century. The town became established in 1835 with the current dimensions and names.
The first data that are still kept about the region are a series of writings from around year 1000. They are about churches and monasteries of the area, which were of great significance as it was around them where the first population areas were consolidated.