As the name of the municipality suggests, it was originally built in the 10th century as a fortification ("Castrum Diani") against incursions by the Saracen pirates. As with many villages around Savona, it later became a fief of the Clavesana marquisate, who built a fortress and ruled till the second half of the 12th century. In the 14th century, Diano Castello became a free municipality ("Communitas Diani"), that controlled the surrounding villages. It later became part of the Republic of Genoa. The people of this village fought along with Genoa against Pisa in the Battle of Meloria (1284). In 1747 it became part of the Austro-Hungarian Empire. In 1797 it came under French rule when it was conquered by Napoleon Bonaparte. In 1815 it was assigned to the Kingdom of Sardinia. Finally, in 1860 it became part of the Kingdom of Italy. The earthquake of 1887 inflicted serious damage to the churches and the historical monuments