Some historians believe that the Croats are Slavic people who probably migrated from Ukraine towards the end of the 6th century and settled in the Balkans. In the eighth century, the Croats lived either under Byzantine or Frankish rule and the population was gradually converted into Christianity. Later, the Croats formed the principalities of Pannonia and Dalmatia, which lwere unified under a single Croatian kingdom in 924 AD. In 1102, as a result of a succession dispute, the kingdom offered the throne to the Hungarian king, who accepted, thus forging a link between Croatia and Hungary politically and culturally which lasted for centuries.
After the rise of the Ottoman Empire, it put constant pressure everywhere, and by 1550 defeated Hungary in two wars and overran eastern and southern Croatia. Hungary and Croatia then decided to seek the protection of the Hapsburg Empire, which proved successful in fending off the Ottomans in the next three centuries. The Hapsburgs tightened control of the new territories by introducing into Croatia ethnic Serbs, Hungarians and other Slavs to be peasant border guards; this is the cause of the subsequent ethnic mix in Croatia. Meanwhile, Croatia tried to retain more control over its own affairs, culture and language, but was not always successful.
In the 19th century, the turmoil caused by the Napoleon War and the social revolution of 1848 created the environment which resulted in Croatia gaining domestic autonomy in 1868 while remaining under the authority of the Austro-Hungarian Empire. Following the demise of the Austro-Hungarian Empire after WW I, Croatia joined the Kingdom of Serbs, Croats, and Slovenes. After World War II, the country became the Federal Socialist Republic of Yugoslavia under the communistic leadership of Marshall Tito.
With the death of Tito and the fall of communism in the 1980s, the Yugoslav federation began to unravel because of long-seated nationalistic, religious and political differences among the constituent republics. With tension amounting, the long-time Croatian nationalist President Franjo Tudjman declared independence from Yugoslavia in 1991. Ethnic Serbs within Croatia followed with an armed insurgency to create a Serbian Republic of Krajina, and civil war erupted. Several cease-fires were declared with United Nation mediation between 1992 and 1995, but all were broken, with Croatia gradually regaining territory lost to the ethnic Serbs.
Armed conflict finally died down after Croatia signed the Dayton peace agreement in December 1995, committing to a permanent cease-fire, the return of refugees and peaceful reintegration of lost territories. Under UN supervision the last Serb-held enclave in eastern Slavonia was returned to Croatia in 1998. The conflict resulted in an exodus of the native Serbian minority (to Bosnia and Serbia) who had lived in Croatia for centuries and made up about 10% of the population before the war.