The Croats came to the Roman provinces of Dalmatia and Pannonia in the 7th century. Ruled by various Croatian rulers, these dukedoms were intermittently controlled by the Eastern Roman Empire and the Franks. Eventually Croatia became a strong independent kingdom in 925, and retained its independence until 1102 when - after decades of inner struggles - the country entered a dynastic union with Hungary. Croatian statehood was preserved through a number of institutions, notably the Sabor which served as an assembly of Croatian nobles, and the ban or viceroy. Furthermore, the Croatian nobles retained their lands and titles.
By the mid-1400s, the Hungarian kingdom was gravely hurt by the Ottoman expansion as much of the mountainous country now known as Bosnia and Herzegovina fell to the Turks. At the same time, Dalmatia became mostly Venetian. Dubrovnik was a city-state that was firstly Byzantine (Roman) and Venetian, but later, unlike other Dalmatian city-states, it became independent as Republic of Dubrovnik, even if it was often under the suzerainty of neighboring powers.
The Battle of Mohács in 1526 led the Croatian Parliament to elect the Habsburgs to the throne of Croatia. Habsburg rule eventually did prove to be successful in thwarting the Ottomans, and by the 18th century, much of the Croatian territories that had previously been occupied were liberated. The odd crescent shape of the Croatian lands remained as a mark, more or less, of the frontier to the Ottoman advance into Europe. Istria, Dalmatia and Dubrovnik all eventually passed to the Habsburg Monarchy between 1797 and 1815.
Following World War I, Croatia joined the State of Slovenes, Croats and Serbs (comprising what is today, Slovenia, Croatia and Bosnia). Shortly thereafter, this joint state in turn formed a union with Serbia to form the Kingdom of Serbs, Croats and Slovenes (which eventually became Yugoslavia in 1929). Yugoslavia was invaded during World War II and Croatia was transformed by fascist forces into the Independent State of Croatia, which was actually a puppet state of the Axis. When the Axis powers were defeated, the anti-fascists reintegrated the country into Yugoslavia, which became a federal socialist state.
Along with Slovenia, Croatia declared its independence from Yugoslavia on June 25, 1991, which triggered the Croatian War of Independence. The Serb population living in border areas of Croatia revolted, supported by the Yugoslav army, and the ensuing months saw combat between various Croatian and Serbian armed forces. During this stage of the war, the independence of Croatia was recognized by the international community, while the Serbs proclaimed their own state, the Republic of Serbian Krajina, and by early 1992, troops were entrenched. This stage of the war left hundreds of thousands as refugees on the Croatian side. In 1995, the Croatian Army successfully launched two major offensives to retake the rebel areas by force, leading to a mass displacement of the Serbian population from those areas. A few months later, the war ended upon the negotiation of the Dayton Agreement. A peaceful reintegration of the remaining Serbian-controlled territories was completed in 1998 under UN supervision.
Croatia is currently in the process of joining the European Union.