The campaign to establish Austro-Hungarian rule in Bosnia and Herzegovina lasted from 29 July to 20 October 1878 against the local resistance fighters supported by the Ottoman Empire.
Nevertheless, in order to assure the maintenance of the new political state of affairs, as well as freedom and security of communications, Austria-Hungary reserves the right of keeping garrisons and having military and commercial roads in the whole of this part of the ancient vilayet of Bosnia.
[7] This Austro-Hungarian expansion southward at the expense of the Ottoman Empire was designed to prevent the extension of Russian influence and the union of Serbia and Montenegro.
Resistance to the Austro-Hungarian takeover came mainly from the Orthodox Serbs (43% of the population) and the Bosnian Muslims (39%), barely at all from the Catholic Croats (18%).
[13] The Ottoman army in Bosnia and Herzegovina at the time consisted of roughly 40,000 troops with 77 cannons, that combined with local militias to around 93,000 men.
[5] The original occupying force, the 13th Corps under General Josip Filipović, crossed the river Sava near Brod,[15] Kostajnica and Gradiška.
[16] They encountered resistance by local Muslims under the dervish Hadži Loja, supported (almost openly) by the evacuating Ottoman Army troops.
[17] On 3 August a troop of hussars was ambushed near Maglaj on the Bosna river, prompting Filipović to institute martial law.
[20] The Austro-Hungarian troops were occasionally met with ferocious opposition from elements of both Muslim and Orthodox populations there, and significant battles occurred near Čitluk, Stolac, Livno and Klobuk.
On 19 August the Bosnian capital, Sarajevo, a town of 50,000 inhabitants at the time, was captured only after the deployment of 52 guns and violent street fighting.
However, a state of relative stability was reached soon enough and Austro-Hungarian authorities were able to embark on a number of social and administrative reforms which intended to make Bosnia and Herzegovina into a "model colony".
During the campaign, an article in the German-language Hungarian newspaper Pester Lloyd criticising the army's preparedness for the occupation was censored on the orders of Emperor-King Franz Joseph.
[18] Following the occupation of Bosnia and Herzegovina, Austria-Hungary also occupied the Sanjak of Novi Pazar on September 10, 1879, implementing another one of the conclusions of the Congress of Berlin.