In the first centuries AD, Bosnia was part of the Roman Empire. After the fall of the empire, Bosnia was claimed by the Byzantine Empire and the Western heirs of Rome. Slavs settled in the 7th century, and Serbia and Croatia ruled over parts of Bosnia in the 9th century. With the exception of today's eastern Herzegovina and Humine for the most part of 10th and 11th century Bosnia was ruled by Croatian kingdom. During the 11th and 12th century, power over Bosnia was seized by the kingdom of Hungary. Medieval Bosnian political unit (first duchy, and then the kingdom) gained independence about 1200. It’s difficult to determine the population in the 14th and 15th century, but it is believed to be between 500,000 and one million.

During Ottoman rule, many Bosniaks (residents of Bosnia) accepted Islam. The causes of this process are multiple, but does not differ substantially from the islamization of neighboring countries, from Croatia to Bulgaria. The Turks ruled over Bosnia until 1878., when it became a protectorate of the Austro-Hungarian Empire. However, Slavic movements in neighboring countries were working on the unification of South Slavs. The First World War began when the Austro-Hungarian archduke was assassinated in Sarajevo. After the collapse of Austro-Hungary, Bosnia and Herzegovina joined Yugoslavia, and after that, it came under NDH during the World War II. After the war, the Socialist Yugoslavia was founded, within which Bosnia and Herzegovina became one of the republics.

Bosnia declared its sovereignty in October 1991., and then the referendum to separate from Yugoslavia followed (February 1992). In a referendum the majority of the population decided for an independent Bosnia and Herzegovina. The Bosnian Serbs did not vote on the referendum and supported by neighboring Serbia launched a war in Bosnia and Herzegovina in 1992., to make a division along ethnic principle. Soon the war broke out between all three nations. In March, 1994. The Bosnians and Croats signed an agreement on the establishment of the Bosniak-Croatian federation and the confederation with Republic of Croatia. In the U.S. city of Dayton on 21. November 1995. all the warring parties signed a peace treaty, completing a three-year war (the final agreement was signed in Paris on 14. December 1995.). The Dayton agreement divided Bosnia into two parts - the Federation of BiH and the Republic of Srpska.