Like the rest of the Mediterranean region, Bosnia was part of the Roman Empire. After the fall of Rome, the area of Bosnia was contested between Byzantium and Rome 's successors in the West.
The Bosnian state was first mentioned in Byzantine sources in the early 10th century as one of the polities that had emerged from Slav settlements.
Around 1200 A.D., Bosnia fought for and gained its independence under the rule of local Bans. The independent medieval state of Bosnia endured for more than 260 years. With the crowning of King Tvrtko I (in 1377), Bosnia became a kingdom, and during his rule (1353-1391) Bosnia reached maximum size stretching from the Sava river to the islands of Korcula and Hvar, and from Zrmanja and Knin to Sjenica and Lim. Subsequently, Bosnia was ruled by the Kotromanic dynasty.
Bosnia managed to retain its independence until 1463, when it was incorporated into the expanding Ottoman Empire, within which it survived for more than 400 years as a distinct administrative unit.
Bosnia and Herzegovina remained a separate province after being first occupied (1878), then annexed (1908) by Austro-Hungary. In the summer of 1914, a Serb nationalist youth named Gavrilo Princip assassinated the heir to the Austro-Hungarian throne during a state visit to Sarajevo , thus initiating World War I.
After World War I it was included within the newly created kingdom of Yugoslavia . The country was invaded by Nazi Germany in April 1941. Large number of population actively joined the resistance movement under Tito which liberated the country in May 1945. Bosnia and Herzegovina became one of the Yugoslav republics ruled by the communist government until 1992 when Bosnia and Herzegovina declared its independence, prompting Serbian invasion. During the war over a quarter of a million Bosnians lost their lives and over one million left the country, while a further 800,000 became refugees in their own land.
The Dayton Peace Agreement brought an end to the fighting, but left the country divided into two entities - Federation of Bosnia and Herzegovina and Republic of Srpska, joined by a central government.