Bosnia-Herzegovina became part of the Turkish Ottoman Empire in 1389. Over the years Serbs living in the area made several attempts to obtain independence from Turkey. Revolts in 1821, 1831 and 1837 ended in failure. Armed insurrection against Turkish rule in 1874 was also unsuccessful. However, the Serbs living in Bosnia now had a powerful supporter in Russia. When Russia defeated Turkey in 1877, it forced the Turkish government to promise independence to Serbia and Rumania, autonomy to Bulgaria and reforms to Bosnia-Herzegovina.
Other European powers became concerned about the growth of Russian influence and in 1878 held the Congress of Berlin. The settlement reached at the conference resulted in independence for Serbia and Rumania and autonomy for Bulgaria. However, Bosnia-Herzegovina came under the control of Austria-Hungary. In 1908 this was consolidated when the territory was added to the Austria-Hungarian Empire.
The population of Bosnia and Herzegovina at this time was about two million. Over 40 per cent were of the Serb-Orthodox faith, 30 per cent were Moslems and about 25 per cent were Roman Catholics. The remainder were Jews and Protestants. Most of the Serb-Orthodox group were Serbs who favoured union with the state of Serbia. Unhappy with Austria-Hungarian rule, some joined terrorist organizations such as the Black Hand group.
In 1911 Bogdan Zerajic attempted to assassinate General Varesanin, the Austrian governor of Bosnia. Zerajic failed and so did Muhamed Mehmedbasic when he tried to kill General Oskar Potiorek, Governor of the Austrian provinces of Bosnia-Herzegovina in 1914. However, later that year, another member of the Black Hand group, Gavrilo Princip, assassinated Archduke Franz Ferdinand, Inspector of the Austro-Hungarian Army and heir to the throne.