Macedonia's first democratically elected president, Kiro Gligorov, who helped steer the Balkan country's peaceful breakaway from Yugoslavia, has died aged 94, his office said on Monday.

He died overnight in his sleep at his home in the Macedonian capital, Skopje, his office said.

Gligorov was elected president of Macedonia in 1991 as the country of 2 million people moved to declare independence, and helped steer its bloodless transition to statehood as fellow Yugoslav republics Croatia and Bosnia descended into war.

While president, he survived an assassination attempt in 1995 when a bomb exploded near his motorcade, killing his driver. The perpetrators were never found.

He served two terms as president until 1999.

Two years later, fighting between government forces and ethnic Albanian guerrillas dragged Macedonia to the brink of civil war, but Western diplomacy helped broker a peace deal offering Macedonia's 25-percent ethnic Albanian minority greater rights and representation.

(Reporting by Kole Casule; Editing by Matt Robinson and Alessandra Rizzo)