From the 14th to the 19th cent. the principal activity of the fiercely independent Montenegrin people was fighting the Turks, who never entirely conquered their mountain stronghold. In the 14th cent. the region constituting present Montenegro was the virtually independent principality of Zeta in the Serbian empire. After Serbia was defeated by the Turks in the battle of Kosovo Field (1389), Montenegro continued to resist and became a refuge for Serbian nobles who fled Turkish rule. The sultans did not recognize Montenegrin independence, but, although they thrice destroyed Cetinje, they never succeeded in making Montenegro tributary. However, the princes of Montenegro ruled only a small part of the present republic, the rest being governed by Turkey after 1499 and by Venice, which held Kotor.
From 1515 until 1851 the rule of Montenegro was vested in the prince-bishops ( vladikas ) of Cetinje; these were assisted by civil governors. Social organization, geared almost exclusively to the needs of war, was largely military and patriarchal. With Danilo I, who ruled from 1696 to 1735, the episcopal succession was made hereditary in the Niegosh family, the office passing ordinarily from uncle to nephew, because the bishops could not marry. Danilo I also inaugurated (1715) the traditional alliance of Montenegro with Russia; the emperors of Russia were henceforth considered as at least the spiritual suzerains of the vladikas.
Peter I, who reigned from 1782 to 1830, defied both France and Austria when the Treaty of Campo Formio (1797) transferred the Venetian possession of Kotor to Austria, but he failed to obtain the coveted port. However, in 1799, Sultan Selim III recognized the independence of Montenegro. Peter I instituted internal reforms and sought to end the blood feuds and lawlessness that had become a traditional way of life. He was canonized as a saint after his death. Peter II (reigned 1830–51), a gifted poet, continued his predecessor's work of reform and fostered a revival of learning and culture; aside from occasional border warfare, he lived in relative peace with his neighbors, Turkey and Austria. Danilo II, who succeeded him, secularized his principality in 1852 and transferred his ecclesiastic functions to an archbishop.
Under Nicholas I (reigned 1860–1918) Montenegro was formally recognized as an independent state at the Congress of Berlin (1878), which increased its territory and gave it a narrow outlet on the Adriatic. In 1910, Nicholas proclaimed himself king. He fought Turkey in the Balkan Wars and took Shkodër in 1913, but was forced by the pressure of the European powers to evacuate the city. Montenegro did, however, receive part of the territory claimed by newly independent Albania.
When World War I broke out (1914), the Montenegrins invaded Albania. Montenegro declared war on Austria in Aug., 1914, but late in 1915 it was overrun by Austro-German forces. In Nov., 1918, a national assembly declared Nicholas deposed and effected the union of Montenegro with Serbia. Under the centralized, Serbian-dominated government of what became the Kingdom of Yugoslavia, Montenegro largely ceased to exist. In 1922 the Serbian Orthodox Church was declared the official church and the Montenegrin branch was outlawed. After World War II, Montenegro was reestablished as (1946) one of the six republics of Yugoslavia, and its territory was enlarged with the addition of part of the Dalmatian coast.
As Yugoslavia began to disintegrate in the early 1990s, Montenegro and Serbia were the only republics in which the electorate kept the Communists in power and voted to remain in the Yugoslavian federation. Although Montenegro backed the Serbs militarily early in the civil war, it moved away from armed engagement and vigorously protested being grouped with Serbia when UN trade sanctions were imposed in 1992. The sanctions crippled shipping and tourism and caused economic hardship. When they were temporarily lifted in 1995, Montenegro privatized businesses and pursued a market economy.
Milo Djukanović, a supporter of increased sovereignty or independence for the republic, was elected president of Montenegro in 1997. Although many Montenegrins desired independence from Serbia, many others opposed it. Montenegro was not heavily attacked by NATO during the Kosovo crisis of 1999, but many Montenegrins sympathized with Serbia. Relations with Serbia, which grew increasingly strained in 1999 and 2000, eased after Vojislav Koštunica became (Oct., 2000) Yugoslav president, but Djukanović did not waver in his support for a looser Yugoslav federation or independence. In Nov., 1999, Montenegro adopted the German mark as legal tender along with the dinar; the mark (the euro, after Mar., 2001) became the sole currency in Nov., 2000. Djukanović's Democratic party of Socialists (DPS) won the largest bloc of seats in the Apr., 2001, elections, but failed to win a parliamentary majority.
After failed talks later in the year on the future of the Yugoslav federation, the Montenegrin and Yugoslavian presidents agreed that Montenegro would hold a referendum on independence in May, 2002. That referendum was postponed, however, by the signing in Mar., 2002, of a pact that called for restructuring the federal government. The accord led to a constitution establishing the "state union" of Serbia and Montenegro in Feb., 2003. Both republics gained increased autonomy under the new constitution; the federal government was responsible primarily for foreign policy and defense.
In Nov., 2002, Djukanović resigned as president to become prime minister. The December and February presidential elections were legally inconclusive due to low turnout. After the election law was amended to require only a majority of those voting to win the presidency, Filip Vujanović, an ally of the prime minister's, was elected in May, 2003. A proposal (Feb., 2005) by the president and prime minister that Montenegro and Serbia each recognize the other as an independent nation was rejected by Serbia as a violation of of the 2002 accord, which postponed any such move until 2006. In May, 2006, however, Montenegrin voters approved (by slightly more than 55%) independence, with ethnic Serbs strongly opposing the move.
In June, 2006, Montenegro formally declared its independence, and in the September elections following independence, Djukanović's DPS-led coalition won a majority of the seats in parliament. Djukanović resigned as prime minister the following month; Željko Šturanović, the justice minister, was chosen as his successor. A new constitution was adopted in Oct., 2007, but the Serb and Albanian opposition parties did not vote for it. Šturanović resigned in Jan., 2008, for health reasons, and Djukanović succeeded him as prime minister the following month. President Vujanović was reelected in Apr., 2008.
The Mar., 2009, elections again gave the DPS-led coalition a parliamentary majority. Djukanović resigned as prime minister in Dec., 2010, possibly as a result of European Union pressure (he had been accused of criminal activities); the finance minister, Igor Lukšić, succeeded him. The DPS-led coalition fell short of a majority in the Oct., 2012, elections, forcing it into a coalition with small ethnic minority parties; Djukanović was confirmed as prime minister in December. In the Apr., 2013, presidential election, Vujanović was narrowly reelected, but the opposition disputed the results and alleged that there were irregularities in the vote. The narrow victory was seen as a blow to the government.