 In the 10th century the village was located closer to the valley floor around the church of San Tommaso but the position was too vulnerable and the politics surrounding the town too volatile, so the location father up the hill was chosen for a new settlement.In the 13th century, before 1258, the village belonged to the nobility of the coastal town of Ventimiglia found at the mouth of the valley, but later in that year it yielded to the town Anjou of Provence.Soon after, the war between the Guelph's of Provence and Ghibellines of Genoa was raging in the valley, with Pigna on the side of the Guelph's (owing to its relationship with Provence) against the Doria of Dolceaqua (on the side of the Ghibelline's).