Under the 1878 Treaty of Berlin, Austria-Hungary received the mandate to occupy and administer the Ottoman Vilayet of Bosnia, while the Ottoman Empire retained official sovereignty. Under this same treaty, the Great Powers (Austria-Hungary, the United Kingdom, France, the German Empire, Italy, and the Russian Empire) gave official recognition to the Principality of Serbia as a fully sovereign state, which four years later transformed into a kingdom under Prince Milan IV Obrenović who thus became King Milan I of Serbia. Serbia's monarchs, at the time from the royal House of Obrenović that maintained close relations with Austria-Hungary, were content to reign within the borders set by the treaty.