The history of Serbia covers the historical development of Serbia and of its predecessor states, from the Early Stone Age to the present state, as well as that of the Serbian people and of the areas they ruled historically. Serbian habitation and rule has varied much through the ages, and as a result the history of Serbia is similarly elastic in what it includes.
Serbs settled the Balkans in the 6th and 7th centuries, with the most prominent settlement being the First Serbian Principality of the Vlastimirovići dynasty ruling over modern-day Montenegro, Bosnia, Dalmatia, and Serbia. It evolved into a Grand Principality by the 11th century, and in 1217 the Kingdom and national church (Serbian Orthodox Church) were established, under the Nemanjić dynasty. In 1345 the Serbian Empire was established, spanning most of the Balkan peninsula. In 1540 Serbia became a part of the Ottoman Empire.
A significant number of Serbs migrated north, to the Kingdom of Hungary forming what will later become Serbian Vojvodina. Serbian revolution against Ottoman rule in 1817 marked the birth of the Principality of Serbia, which achieved de facto independence in 1867 and gained full recognition by the Great Powers in the Berlin Congress of 1878. As a victor in the Balkan Wars of 1912–1913, Serbia regained Vardar Macedonia, Kosovo and Metohija, and Raška (Old Serbia). In late 1918, with the defeat of Austro-Hungarian empire, Serbia was expanded to include regions of the former Serbian Vojvodina. Serbia was united with other Austro-Hungarian provinces into a pan-Slavic State of Slovenes, Croats and Serbs; the Kingdom of Serbia joined the union on 1 December 1918, and the country was named the Kingdom of Serbs, Croats, and Slovenes.
Serbia achieved its current borders at the end of World War II, when it became a federal unit within the Federal People's Republic of Yugoslavia (proclaimed in November 1945). After the dissolution of Yugoslavia in a series of wars in the 1990s, Serbia once again became an independent state on 5 June 2006, following the breakup of a short-lived union with Montenegro.