 Some of Bosniaks came from Slavonia after 1687, when Turkey lost all the lands north of Sava in the Austro-Turkish war.Many more came from Herzegovina in the post-1876 period, after the Herzegovina Rebellion staged by the Serbs against Austro-Hungary and their Muslim subjects.Another wave followed immediately thereafter from both Bosnia and Herzegovina, as the Treaty of Berlin placed the Vilayet of Bosnia under the effective control of Austria-Hungary in 1878.