It was originally built in the Moorish era, although it was later modified and became a walled enclosure with two towers. Following this, it was knocked down and the current enclosure was built. First known as the Palacio de los Urrea, and later as the Palacio de Híjar, it was partly demolished by Carlist attacks before being remodelled in 1876 to be used as a prison. In 1998, it was refurbished to house an ethnological museum. This museum has a room full of old flour mills and an exhibition of dolls from all eras. It also houses the town's cultural centre.