Napoleons expansive governance led in 1805 to a 2nd War with Great Britain and also against Austro-Hungaria, "Battle of Austerlitz", where the Austro-Hungarian Armies were defeated. Dalmatia, which after Napoleons occupation of Venice in 1797 fell under Austro-Hungaria, as Illyricum province became a French protectorate.
In 1806 Napoleons troops marched into Dubrovnik. The city state Republic of Ragusina, the free Republic of Dubrovnik, resisted occupation with all political means. In the end, the Republic broke up and became a part of the Illyricum protectorate.
After Napoleons defeat in Russia in 1812 / 1813 and the subsequent war of independence by the Russian, Prussian and Austrian armies, the new order of Europe of the Vienna Congress of 1814 followed. Dubrovnik hoped of his restitution but Dalmatia and Dubrovnik became a part of Austro-Hungaria. Until 1918 Dubrovnik remained a part of Austro-Hungaria. The free Republic of Dubrovnik sceased to exist.