Since Macedonia's independence from Yugoslavia in 1991, Greece has feared its neighbor could make territorial claims on its northern region of Macedonia - the birthplace of Alexander the Great.
The long-running dispute has centred on Greece's objection to Macedonia's name, which has prompted it to block its neighbour from joining North Atlantic Treaty Organisation and the European Union until it is changed.
Zaev said resolving the long-standing issue would open Macedonia's access to North Atlantic Treaty Organisation and the European Union.
The compromises to resolve the name issue have faced dissent in both countries, threatening to split Greece's governing coalition and provoke a rift between Macedonia's prime minister and president.
Previous administrations in Macedonia's capital, Skopje, resisted demands to change or modify the name.
Greek Prime Minister Alexis Tsipras. Credit PA
Significantly, they agreed that the new name would be used both internationally and bilaterally, so that even the 140 or more countries that recognize the name Macedonia will also have to adopt North Macedonia.
In 1992 more than a million Greeks joined a rally in the northern city of Thessaloniki, once the most important city in ancient Macedonia, to proclaim "Macedonia is Greek". "With this solution we are strengthening Macedonian ethnic and cultural identity, once and for all", he added.
Both Albania and Macedonia hope to launch full membership negotiations with the European Union. "I am keeping my fingers crossed".
'This historic agreement is testament to many years of patient diplomacy, and to the willingness of these two leaders to solve a dispute which has affected the region for too long, ' NATO Secretary General Jens Stoltenberg said in a statement. So if you like The Pappas Post and want to help, please consider becoming a "philotimo subscriber".
Greek PM Alexis Tsipras also confirmed that an agreement on the name has been reached. The dispute poisoned relations between the two neighbours, and the United Nations appointed a special envoy to mediate.
The prime minister of Greece says his country has reached an agreement with Macedonia to end a decades-old dispute over the neighboring country's name.
Hristijan Mickoski, president of Macedonia's opposition party VMRO-DPMNE, said: "Today is a hard day for the Republic of Macedonia".
Greece is to ratify the deal in parliament after Macedonia has made the necessary changes to its constitution, Tsipras said.