The first Serbian state was formed in the mid 9th century, expanding by the mid 14th century to an empire comprising most of the Balkans. In 1389, Serbs lost a decisive battle in the Kosovo field against Ottoman empire. Serbia managed to preserve its freedom for another seventy years only to be finally overwhelmed by the Turks in 1459. An uprising in the early 1800s that grew in the full scale war (War of Restoration) led to the restoration of Serbian independence in 1815.
The 1914 Austro-Hungarian invasion of Serbia following the assassination of Archduke Ferdinand by an ethnic Serb high school student precipitated the first World War. In its aftermath,in 1918, victorious Serbia gatherd all south Slav lands (Croatia, Slovenia, Slavonia, Dalmatia, Bosnia and Herzegowina, and Montenegro)into the Kingdom of Serbs, Croats, and Slovenes; The country's name was changed to Yugoslavia in 1929. Invasion and occupation by Germany and Italy in 1941 was resisted by Yugoslav Army in fatherland (Chetniks), commanded by Lt.-Gen Dragoljub Mihajlovic and communist led guerilla (partisans) who eventually started fighting each other as well as the invaders. The partisans, commanded by Field-Marshal Josip Broz Tito emerged victorious and formed a provisional governement that abolished monarchy and proclaimed republic in 1946 after a dubious referendum. At the end of the war nearly all ethnic Germans left the country. Although pro-Communist, J.B. Tito's new government successfully steered its own delecate path between the Warsaw Pact nations and the West for the next four and a half decades.
In the early 1990s, post-Tito Yugoslavia began to unravel along ethnic lines: Slovenia , Croatia, and the Former Yugoslav Republic of Macedonia all split from the Yugoslav Union in 1991; and Bosnia and Herzegovina in 1992. All of efforts to preserve Yugoslavia were ultimately unsuccessful and bloody civil wars broke out in Croatia and in Bosnia. The remaining republics of Serbia and Montenegro declared a new "Federal Republic of Yugoslavia" (FRY) in 1992. Slobodan Milosevic was elected the first president of Serbia. In the late 1990s, the conflict with the Albanian separatist movement in Kosovo led to a NATO bombing campaign and direct intervention, which left the placement of Kosovo under UN administration. Slobodan Milosevic, by this time elected for the president of the federation, lost Federal elections in the fall of 2000 to Vojislav Kostunica. The country reestablished its membership in the OUN and started preparations to join the EU. In 2002, the republics of Serbia and Montenegro began negotiations to forge a looser relationship, which led first to the name change of the nation to "Serbia and Montenegro", then culminated in Montenegro declaring independence in June 2006. More recently Kosovo unilaterally declared its independence, however this act remains unrecognised by Serbia and most other countries.