This is the history of the Yugoslav state. For history of the region before 1918, see history of Slovenia, Croatia, Bosnia and Herzegovina, Serbia, Montenegro and Macedonia. Also see history of Europe and list of extinct countries, empires, etc
In 1918, in the aftermath of World War I, parts of Austria-Hungary which were populated by Southern Slavs seceded and formed the State of Slovenes, Croats and Serbs. This short-lived state soon, on December 1, 1918, joined Serbia and Montenegro to form "The Kingdom of Serbs, Croats and Slovenes".
On Vidovdan 1921, a new constitution was passed in the Parliament (Skupština) which made the country more centralized, despite a boycott from Croat political parties. On January 6 1929, king Aleksandar went a step further by proroguing the Skupština and proclaiming a royal dictatorship. He went on to reorganize the regional divisions within the country and renamed it to Kingdom of Yugoslavia (Jugo- = Southern).
In the beginning of World War II, Yugoslavia was pressured by Germany and Italy to join the Axis powers. Italy was losing its war with Greece, and Germany wanted Yugoslavia's support before aiding the Italians by invading Greece. Yugoslavia's regent Paul actually signed the Tripartite Treaty in Vienna on March 25, 1941, but this was against the will of most Yugoslavs, and he was met by a coup d'état when he returned on March 27. Army General Dusan Simovic seized power, arrested the Vienna delegation, exiled Paul and instated the 17-year old crown prince Peter as the new king. This was said to make Hitler furious, and the Axis decided to attack both Yugoslavia and Greece on April 6. (The German high command also decided to delay Operation Barbarossa 4 weeks because of this, something which turned out to be disastrous for Germany.)
At 05:15 on April 6, German, Italian, Hungarian, and Bulgarian forces attacked Yugoslavia. The Luftwaffe bombed Belgrade and other major Yugoslav cities. The Axis powers soon occupied Yugoslavia and split it up. The Independent State of Croatia was established as a nazi puppet-state, ruled by the right-wing militia Ustaše. German troops occupied Serbia, while other parts of the country were back to Albania, Bulgaria, Hungary and Italy.
Yugoslavs opposing the Nazis joined the partisan forces (National Liberation Army), led by Croat Josip Broz Tito. The NLA staged a wide-spread guerrilla campaign, and the Germans answered by punishing the civil population. This led to great losses for Yugoslavia, approximately 1,700,000 (10% of the population). In liberated territories, NLA organized people's committees to act as civilian government. On November 25, 1942, the Anti-Fascist Council of National Liberation of Yugoslavia was convened in Bihać. The council reconvened on November 29, 1943 in Jajce and established the basis for post-war organisation of the country, establishing a federation (this date was celebrated as Republic Day after the war). The NLA was able to expel the Axis from Serbia in 1944 and the rest of Yugoslavia in 1945. The Red Army aided in liberating Belgrade. After the war, Yugoslavia was reunited as an independent Communist state with Tito as prime minister.
On January 31, 1946 the new constitution of Federal People's Republic of Yugoslavia, modeling the Soviet Union, established six constituent republics (Bosnia-Herzegovina, Croatia, Macedonia, Montenegro, Serbia and Slovenia). Then on April 7, 1963 the nation changed its official name to Socialist Federal Republic of Yugoslavia and Josip Broz Tito was named President for life.
After Tito's death in 1980, and the fall of Communism in Eastern Europe, ethnic tension grew in Yugoslavia. Serbian communist leader Slobodan Milošević, the new strong man of Yugoslavia, tried to play on the revived Serb nationalism, but ended up alienating all the other ethnic groups in the federation. Republics of Slovenia and Croatia declared independence from Yugoslavia in 1991; Macedonia followed in 1992 together with Bosnia-Herzegovina, albeit only two out of three constitutive people's, Bosniaks and Croats.
The Socialist Federal Republic of Yugoslavia officially ceased to exist on April 28, 1992, when the Federal Republic of Yugoslavia (FRY) was formed. Other dates that are frequently considered as the end of SFRY are June 25, 1991, when Slovenia declared independence, October 9, 1991, when the moratorium on Slovenian and Croatian secession (agreed on July 9 at Brioni by representatives of all republics) was ended and January 15, 1992, when Slovenia and Croatia were internationally recognized.
Ethnic problems and attempts by the Yugoslav People's Army (Jugoslavenska Narodna Armija, JNA) to prevent secession of the new-formed states led to a bloody and gruesome war from 1991 to 1995 in Croatia and Bosnia. As a result of the conflict, the United Nations Security Council unanimously adopted UN Security Council Resolution 721 on November 27, 1991, which paved the way to the establishment of peacekeeping operations in Yugoslavia.  Milošević's regime manipulated the Serbs in an attempt to subdue the breakaway republics, successfully at first but ultimately failing. The war in the western parts of former Yugoslavia ended in 1995 with U.S-sponsored peace talks in Dayton, Ohio, with the so-called Dayton Agreement.
Milošević then turned his attention to the southeast. NATO had already deployed a small amount of troops on the border with Macedonia, but that didn't stop ethnic cleansing in Serbia's autonomous province of Kosovo and Metohia in 1998. NATO bombed Serbia and Montenegro for more than two months (see Kosovo War). Since June 1999, Kosovo has been governed by peace-keeping forces from NATO and Russia, although all parties continue to recognise Kosovo as a part of Serbia.
Milošević's rejection of claims of a first-round opposition victory in new elections for the Federal presidency in September 2000 led to mass demonstrations in Belgrade on October 5 and the collapse of the regime's authority. The opposition's candidate, reformed nationalist Vojislav Koštunica took office as Yugoslav president on October 6.
On April 1, 2001, Milošević was arrested on charges of abuse of power and corruption. On June 28 he was extradited to the United Nations International Criminal Tribunal for the Former Yugoslavia. His trial on charges of genocide in Bosnia and war crimes in Croatia and Kosovo began at The Hague on February 12, 2002. On April 11, the Yugoslav parliament passed a law allowing extradition of all persons charged with war crimes by the International Criminal Tribunal.
In March 2002, the Governments of Serbia and Montenegro agreed to dissolve FRY in favour of a new, much weaker form of cooperation called "Serbia and Montenegro". By order of Yugoslav Federal Parliament on February 4, 2003, Yugoslavia ceased to exist.