At the Congress of Berlin in 1878, the Austro-Hungarian Foreign Minister Gyula Andrássy obtained the occupation and administration of Bosnia and Herzegovina, and he also obtained the right to station garrisons in the Sanjak of Novi Pazar, which would remain under Ottoman administration until 1908, when the Austro-Hungarian troops withdrew from the Sanjak.