From its establishment the town was under the protection of the Byzantine Empire that helped Dubrovnik in the wars against Saracens (886-887), Bulgaro-Macedonians (988), and Serbs (1184).
After Crusades Dubrovnik came under the sovereignty of Venice (1205-1358), and by the Peace Treaty of Zadar in 1358 it became part of the Hungarian-Croatian Kingdom. Having been granted the entire self-government (bound to pay only a tribute to the king and providing assistance with its fleet), from that moment Dubrovnik started its life as a free state that reached its peak in the 15th and the 16th centuries.
In 1526 Dubrovnik acknowledged the supremacy of Turkish Sultan (annual tribute was paid to the Sultan). A crisis of Mediterranean shipping and especially a catastrophic earthquake on 6 April 1667 that killed over 5000 citizens (including the Rector) and leveled most of the public buildings ruined the well-being of the Republic. With great effort the Republic recovered a bit, but still was a shadow of the former Republic.
In 1806 surrendered to French forces, as that was the only way to cut a month's siege by the Russian-Montenegrin fleets (during which 3000 cannon balls fell on the city). French lifted Russian-Montenegrin fleets, and saved Dubrovnik, for the time being. The French entered Dubrovnik in 1806; in 1808 Marshal Marmot abolished the Dubrovnik Republic (the name was in use from the 15th c.).
1809 Dubrovnik become the part of the Ilyrian Provinces. In 1815, by the resolution of Vienna Congress Dubrovnik was annexed to Austria (later Austria-Hungary), and remained annexed until 1918 when it became the part of Kingdom of Serbs, Croats, and Slovenes.
In 1929 The Kingdom of Serbs, Croats, and Slovenes became the Kingdom of Yugoslavia, and was divided into 8 districts. Until 1939 Dubrovnik was the part of Zetska district, and then, was included in Banovina of Croatia.
At the very beginning of the World War II Dubrovnik was first the part of Independent State of Croatia. From April 1941 until September 1943 Dubrovnik was occupied by Italian army, and after that it was occupied by Germans. In October 1944 Partisans liberated Dubrovnik from Germans.
In 1945 Dubrovnik became a part of Federative People's Republic of Yugoslavia. In 1963, Federative People's Republic of Yugoslavia changed its name into Socialist Federal Republic of Yugoslavia, and was consisting of 6 Republic. Dubrovnik was the part of Socialistic Republic of Croatia.
In 1990, Republic of Croatia reached the independence.
At October 1, 1991 Dubrovnik was brutally attacked by Serbo-Montenegrin army. The Serbo-Montenegrin siege of Dubrovnik lasted for seven months, and in May 1992 the Croatian Army liberated the local surroundings of Dubrovnik. But the danger of Serbo - Montenegrin sudden attacks lasted another three years.
Today, Dubrovnik is free and safe town, worldly known and the most popular tourist destination in Croatia.