Erguel Castle, now in ruins, was built south-east of the village in the 11th century. The castle was the center of government for the lands that the Lords of Arguel (or Erguel) ruled. In 1264 Otto von Erguel, who at the time lived in Basel, ceded the lands to the Prince-Bishop of Basel. In return the bishop granted him lands in Alsace. Under the Prince-Bishop the Erguel lands, including Sonvilier, became part of the seigniory of Erguel. During the 13th and 14th century a local noble family was mentioned in Sonvilier. During the 16th century the municipality was the largest in the Erguel and was home to a half dozen mills that were held in fief to the Prince-Bishop of Basel.