Formerly tributary to the Byzantine Empire and the later medieval Serbian kingdom, the area came under the sway of the independent principality of Zeta towards 1360. Never fully conquered by the Ottoman Empire which controlled the lands to the south and east from the 15th century, Montenegro in 1516 came under the rule of the prince-bishop (vladika) of Cetinje, a position held from 1697 by the Petrovic family.
The reign of Nicholas I (1860-1918) saw the doubling of Montenegro's territory and international recognition of her independence (1878), the country's first constitution (1905), the ruler's elevation to the rank of King (1910), and further territorial gains following the Balkan Wars (1913), though the newly-captured city of Shkodër had to be given up for inclusion in Albania at the insistence of the great powers.
After Montenegro's entry into World War I on the side of Serbia (August 1914), her occupation by German and Austro-Hungarian forces (January 1916) forshadowed the end of independence: accused of seeking a separate peace with the enemy, Nicholas was deposed by the National Assembly after the country's liberation and union with Serbia proclaimed (Novemnber 29, 1918).