The consequent boost to trade with the rest of Europe led to a boom in Montenegro's development. More territorial gains in the Balkan Wars (1912-13) resulted in a shared border with Serbia. King Nicholas was driven from the country by a foreign army in WWI and at the war's end, Montenegro joined Serbia, Croatia, Slovenia, Bosnia-Hercegovina and Macedonia in the Kindom of Serbs Croats and Slovenes. The name was changed to Yugoslavia in 1929, but this couldn't still the ethnic divisions bubbling beneath the surface of the new entity.
In 1941 Yugoslavia signed up with the fascists, but the people overthrew the reigning regent and pulled out of the alliance. Hitler invaded, slicing the defeated country up and handing Montenegro over to Italy.
Yugoslavia kept its independence after WWII, thanks to the immense wartime efforts of its partisans, and in 1945 the Communist Party, under Josip Broz Tito, came to power. Montenegro, along with Bosnia-Hercegovina and Macedonia, was granted republic status and started a program of industrialisation. In 1987 Slobodan Milosevic - who had risen to power on the back of Serbian nationalist rhetoric - got his turn as Yugoslav president. His vision of a 'Greater Serbia' was the last straw for Slovenes and Croats, who sensed the time was right and voted in free elections to declare their independence in June 1991.
Opposing the break-up of the Yugoslav federation that this threatened, Montenegro joined Slobodan Milosevic's Serbia in fighting to prevent the secession, and in 1992 the two countries united to become the Federal Republic of Yugoslavia. However, Serbian belligerence in the ongoing war and their control of power in the republic led to growing tension within Montenegro. In the war with Croatia centuries-old grudges spewed to the surface in atrocious fashion, leaving mass carnage, a path of destruction and thousands dead before a UN-brokered cease fire called an end to the fighting in January 1992. The EC recognised Croatian and Slovenian independence, whereupon Macedonia and Bosnia-Hercegovina also demanded recognition.
Following this, on 27 April 1992, Yugoslavia was downsized even further, with only Montenegro electing to remain alongside Serbia in the Federal Republic of Yugoslavia. Although all Yugoslav troops were withdrawn from Bosnia, the 80% Bosnian Serb component of the federal army stayed on, and the war continued. In May 1992 the UN Security Council enforced sanctions by dispatching warships to the Adriatic. By the end of 1996, a Yugoslav-Croat peace treaty had been signed and Bosnia-Hercegovina had been divided between Serbs and Croat-Muslims. Tens of thousands were dead, the country's beautiful landscape and historic towns were torn to shreds, and the region's tourist industry was all but destroyed.
In 1997, Montenegro's ruling political party split into factions supporting or opposing Milosevic and in presidential elections the anti-Milosevic candidate was voted in. Despite these internal troubles in the republic, the response to Albanian agitation for independence in the Serbian region of Kosovo was brutal: hundreds were killed on both sides and tens of thousands more forced to flee forever. Fearful of 'another Bosnia', the USA, Britain, Russia, Germany, France and Italy introduced a new arms embargo on Yugoslavia, but to little avail - Serbian repression continued, the Kosovo Liberation Army responded violently, and in early 1999 NATO bombs started falling in Belgrade. By June 1999, a fragile peace deal had been brokered between Yugoslavia and NATO.
In July 2000 Milosevic changed the rules for presidential elections, expecting the people (rather than the parliament) to vote him in for another four years. But victory in the election on 24 September was claimed by the opposition alliance with 55% of the vote. The country's electoral commission refused to accept the result and called for a second ballot, sparking huge protests. The election was annulled on 4 October and a new election slated for 2001.
On 5 October 2000, people from all over Serbia converged on Belgrade demanding Milosevic's resignation. Battles were fought with police, parliament was stormed, and finally, after 12 hours of mass protests, Vojislav Kostunica addressed half a million people outside Belgrade City Hall as the new president.