The patron saint of Castelsardo is Saint Anthony the Abbot, celebrated on 17 January in the concathedral dedicated to him, which holds the altarpiece by the Master of Castelsardo and a bell tower topped by a multicoloured majolica dome; its crypts house the museum devoted to the same Master.
The village was founded in 1102 by the Genoese Doria family, who named it Castelgenovese: according to the 16th-century historian Giovanni Francesco Fara, and the inscription on the town hall's ancient bell, the castle's founding traditionally dates to that year, though excavations by the University of Sassari, led by professor Marco Milanese, have revised this chronology. With a few brief interruptions, Castelsardo was the seat of the Doria in Sardinia during the struggles for possession of the island: Eleonora d'Arborea, wife of Brancaleone Doria, lived there for years, before the Aragonese finally emerged victorious from the conflicts, at a high cost in lives, money and time. The municipal territory also holds the Elephant Rock, a rust-coloured trachyte boulder that broke off Monte Castellazzu in antiquity and was shaped by weathering, inside which a domus de janas holds the relief of a bull's head.