Under Nicholas I, the Principality of Montenegro vastly advanced and enlarged several times in the Montenegro-Turkish Wars and achieved recognition of independence in 1878.

Modernization of the state followed, culminating with the draft of a Constitution in 1905. Political rifts for the first time emerged between the reigning People's Party that supported democratization of the ruler's autocratic regime and unconditional union with Serbia and the minor pro-monarch True People's Party. In 1910 Montenegro became a Kingdom. It initiated the Balkan wars in 1912 and 1913 in which the Ottomans lost all lands in the Balkans, achieving a common border with Serbia, but the Skadar was awarded to a newly created Albania. In World War I in 1914 Montenegro sided with Serbia against the Central Powers, suffering a full scale defeat to Austria-Hungary in early 1916. In 1918 the Allies liberated Montenegro, which was subsequently merged with Serbia. In 1904 Montenegro declared war on Japan in support of Russia. However, Montenegro inexplicably failed to adhere to the Treaty of Portsmouth in 1905 and so remained at war with Japan until 1918, although no hostilities occurred.