At first subjected to the countship of Ventimiglia, the community later passed under the dominion of the Genoese bishops.
After the French domination and the Savoy restoration in 1814, Sanremo was annexed to the Kingdom of Sardinia.