Archaeological excavations have showed the human presence in the area of Castelsardo since pre-Nuragic and Nuragic times, as well as during the Roman domination in Sardinia.
After the fall of the Western Roman Empire, the monastery of Nostra Signora di Tergu was founded nearby, but the current town originates from the castle built here, in 1102 (or 1270), by the Doria family of Genoa. The castle and the village which gradually formed round it where the seat of the Doria's fiefdom in the island called Castel Doria or Castelgenovese, until it was conquered by the Aragonese in the 15th century (1448), and named Castillo Aragonés (Castel Aragonese). Except for the Maddalena archipelago, it was the last city in the island to join the Kingdom of Sardinia.
One of the: I borghi più belli d'Italia (the most beautiful villages of Italy), Les Plus Beaux Villages de la Terre (the most beautiful villages on earth), Città regie della Sardegna (Royal Cities of Sardinia).