In 1882, Serbia was elevated to the status of a kingdom, maintaining a foreign policy friendly to Austria-Hungary. Between 1912 and 1913, Serbia greatly enlarged its territory through engagement in the First and Second Balkan Wars—Sandžak-Raška, Kosovo Vilayet and Vardar Macedonia were annexed. At the end of World War I in 1918 it united with Vojvodina and the Kingdom of Montenegro, and in December 1918 it merged with the newly created State of Slovenes, Croats and Serbs to form the Kingdom of Serbs, Croats and Slovenes (later known as Kingdom of Yugoslavia) under the continued rule of the Karađorđević dynasty.