 During the Peninsular War, Castielfabib was occupied by the French.In the civil wars of the 19th century it was occupied by Carlist forces, who rebuilt the castle; it was later demolished and won back by nationalist forces.The township has remained virtually unchanged since medieval times and has only been a municipality at the expense of the territory of Torrebaja.