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. The scope of 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.
Slavs settled the Balkans in the 6th century, out of which settlement the First Serbian Principality of the Vlastimirovići emerged. 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ći. In 1345 the Serbian Empire was established: it spanned a large part of the Balkans. In 1540 the Ottoman Empire annexed Serbia.
The Serbian realms disappeared by the mid-16th century, torn by domestic feuds and overcome by Ottoman conquest. The success of the Serbian revolution against Ottoman rule in 1817 marked the birth of the Principality of Serbia, which achieved de facto independence in 1867 and finally gained 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 Raška (Old Serbia). In late 1918 the region of Vojvodina proclaimed its secession from Austria-Hungary to unite with the 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.