In 1718,[REF] after the brief rule of the Austrian Habsburgs, the Savoy dynasty obtained the Kingdom of Sardinia, which remained an autonomous institution in relation to the mainland states of the dynasty and solemnly swore to respect the ancient customs and privileges.
In the late 18th century during the Napoleonic wars France tried to conquer Cagliari because of its strategic role in the Mediterranean Sea.