Jabarkan 1918–1991 dari Dubrovnik dalam bahasa melayu

With the fall of Austria–Hungary in 1918, the city was incorporated into the new Kingdom of Serbs, Croats, and Slovenes (later the Kingdom of Yugoslavia). Dubrovnik became one of the 33 oblasts of the Kingdom. When in 1929 Yugoslavia was divided among 9 Banovina, the city became part of the Zeta Banovina. In 1939 Dubrovnik became part of the newly created Banovina of Croatia.

During World War II, Dubrovnik became part of the Nazi-puppet Independent State of Croatia, occupied by the Italian army first, and by the German army after 8 September 1943. In October 1944 Yugoslav Partisans occupied Dubrovnik, arresting more than 300 citizens and executing 53 without trial; this event came to be known, after the small island on which it occurred, as the Daksa Massacre. Communist leadership during the next several years continued political prosecutions, which culminated on 12 April 1947 with the capture and imprisonment of more than 90 citizens of Dubrovnik.

Under communism Dubrovnik became part of the Socialist Republic of Croatia and Socialist Federal Republic of Yugoslavia. In 1979, the city joined the UNESCO list of World Heritage Sites.

Since 1991: Breakup of Yugoslavia and its aftermath

In 1991 Croatia and Slovenia, which at that time were republics within Socialist Federal Republic of Yugoslavia, declared their independence. At that event, Socialist Republic of Croatia was renamed Republic of Croatia.

Despite demilitarisation of the old town in early 1970s in an attempt to prevent it from ever becoming a casualty of war, following Croatia's independence in 1991 Yugoslavia's Yugoslav People's Army (JNA), by then composed primarily of Serbs, attacked the city. The new Croatian government set up military outpost in the city itself. Montenegro, led by president Momir Bulatović, and prime minister Milo Đukanović, coming to power in the Anti-bureaucratic revolution and allied to Slobodan Milošević in Serbia, declared that Dubrovnik would not remain in Croatia because they claimed it historically had never been part of Croatia. This was in spite of the large Croat majority in the city and that very few Montenegrins resided there, though Serbs accounted for 6.8 percent of the population.

On October 1, 1991 Dubrovnik was attacked by JNA with a siege of Dubrovnik that lasted for seven months. The heaviest artillery attack was on December 6 with 19 people killed and 60 wounded. The number of casualties in the conflict, according to Croatian Red Cross, was 114 killed civilians, among them poet Milan Milišić. Foreign newspapers were criticised for placing heavier attention on the damage suffered by the old town than on human casualties. Nonetheless, the artillery attacks on Dubrovnik damaged 56% of its buildings to some degree, as the historic walled city, a UNESCO world heritage site, sustained 650 hits by artillery rounds. The Croatian Army lifted the siege in May 1992, and liberated Dubrovnik's surroundings by the end of October, but the danger of sudden attacks by the JNA lasted for another three years.

Following the end of the war, damage caused by the shelling of the Old Town was repaired. Adhering to UNESCO guidelines, repairs were performed in the original style. Most of the reconstruction work was done between 1995 and 1999. The inflicted damage can be seen on a chart near the city gate, showing all artillery hits during the siege, and is clearly visible from high points around the city in the form of the more brightly coloured new roofs. ICTY indictments were issued for JNA generals and officers involved in the bombing.

General Pavle Strugar, who coordinated the attack on the city, was sentenced to a seven-and-a-half-year prison term by the International Criminal Tribunal for the former Yugoslavia for his role in the attack.

The 1996 Croatia USAF CT-43 crash, near Dubrovnik Airport, killed everyone on a United States Air Force jet with United States Secretary of Commerce Ron Brown, The New York Times Frankfurt Bureau chief Nathaniel C. Nash and 33 other people.