 By this, the counts wanted to establish their power in the area, as the Segarra was at that time the border between Christian and Muslim territories, thereby establishing the first fortress ("castrum Cervarie").When the Western border was established at Lleida at the year 1149, Cervera grew up into terraced houses on the other side of the border.The inhabitants were freed from the feudal lord's abuses and with the royal privileges, the town gradually became established first as a Confraria (1182), then Consolat (municipal organ) (1202), and from 1267 up to the present, as a Paeria.