After months of skirmishes, EU and Nato support enabled the president, Boris Trajkovski, to strike a peace deal. Under the Ohrid agreement, Albanian fighters laid down their arms in return for greater ethnic-Albanian recognition within a unitary state.
Acknowledgement of ethnic-Albanian rights was formalised in amendments to the constitution approved by parliament in late 2001. Ethnic Albanians account for about a quarter of the population.
In August 2004, parliament approved legislation redrawing local boundaries and giving ethnic Albanians greater local autonomy in areas where they predominate.
Recognition of the republic's progress from the brink of civil war came in December 2005 when the EU leaders agreed that it should become a candidate for membership. The EU has urged Macedonia to crack down on corruption ahead of accession talks.
An important milestone on the country's path to EU membership was reached towards the end of 2009, when Macedonian citizens were granted the right to visa-free travel within the Schengen zone.
The country's name remains a contentious issue. It is still referred to formally as the Former Yugoslav Republic of Macedonia (FYROM).
International recognition of the country's split from Yugoslavia in 1991 was held up over Greek fears that its name implied territorial ambitions toward the northern Greek region of Macedonia. Greece lifted a two-year trade blockade only after the two countries signed an accord in 1995.
And in 2008, Nato leaders agreed to invite Albania and Croatia to join the alliance. But Greece blocked Macedonia's invitation because of the dispute over the country's name.
In December 2008, Macedonia decided to take the issue of its name to the International Court of Justice in the Hague.
Three years later, the ICJ ruled that Greece had been wrong to block Macedonia's Nato bid because of the row of the country's name. The decision was a significant diplomatic victory for Macedonia, though it did not address the bilateral dispute over the name.
President: Gjorge Ivanov
Professor Gjorgje Ivanov was sworn in as Macedonia's fourth democratically-elected president on 12 May 2009, following his victory in the second round of the presidential election.
Although he was put forward as a presidential candidate by the governing VMRO-DPMNE party, he is not a member of the ruling party.
Ivanov has spent most of his professional life as a university professor.
During the campaign Mr Ivanov said he would make resolving Macedonia's long-standing dispute with Greece his priority, and would seek a meeting with the President of Greece to that end.
His predecessor, Social Democrat Branko Crvenkovski, who was elected president in April 2004, won praise in the West for supporting reconciliation with the substantial Albanian minority.
Macedonia's presidents are directly elected for a five-year term. The president appoints the prime minister. Legislative power is vested in parliament.
Prime minister: Nikola Gruevski
Nikola Gruevski, leader of the centre-right VMRO-DPMNE, won a snap election in June 2011 and made a deal with his party's ethnic Albanian coalition partner to form a government.
The early election followed an opposition walkout in Parliament, sparked by allegations that the government was interfering in the media.
Mr Gruevski, who is heading the government for a third time, said his priorities would be accession into the EU and Nato, the fight against corruption and organised crime, boosting the economy and lowering unemployment.
He said he was willing to continue a political dialogue with Greece over the use of the name Macedonia.
Mr Gruevski was first asked to form a government after the July 2006 poll, and his party won elections in 2008.
The prime minister is a former World Bank economist, amateur boxer and stage actor.
The constitution guarantees freedom of speech and access to information. Public TV, which has three national channels, faces stiff competition from private networks.
Media outlets are strongly divided along ethnic lines, US-based Freedom House reported in 2010.
Commercial TV dominates the ratings, according to an EU-sponsored report. It described the broadcasting market as overcrowded, with more than 100 TV and radio stations. Most local broadcasters were "barely surviving" financially.
There were just over a million internet users by mid-2010, around 51 per cent of the population (Internetworldstats).