The prime minister of Greece says his country has reached an agreement with the country's northern neighbour to end a 27-year dispute over Macedonia's name that has kept the former Yugoslav republic out of Nato.
Alexis Tsipras said a deal had been reached that would give Macedonia a different name that would be used domestically and internationally.
Mr Tsipras did not immediately reveal what that name will be.
Since Macedonia's independence from Yugoslavia in 1991, Greece has argued that the young country's name implied a claim to the territory and ancient heritage of Greece's northern region of Macedonia - birthplace of ancient warrior king Alexander the Great.
Previous administrations in Macedonia's capital, Skopje, resisted demands to change or modify the name.
The dispute poisoned relations between the two neighbours, and the United Nations appointed a special envoy to mediate.
Resolving the dispute would see Greece lift its objections to Macedonia's accession to Nato and the European Union.
In Skopje, the opposition party VMRO-DPMNE, said Macedonian prime minister Zoran Zaev had informed party leader Hristijan Mickoski that he had "achieved a solution with Greece".
Mr Tsipras's comments came shortly after a much-anticipated phone call with Mr Zaev.
"A short while ago we reached an agreement with the prime minister of the former Yugoslav republic of Macedonia on the disagreement our two countries have," Mr Tsipras told President Prokopis Pavlopoulos.
"We have a good agreement that covers all the preconditions the Greek side had set," he said, adding that Macedonia would revise its constitution for the name change and that the deal "secures the historic heritage of ancient Greek Macedonia".
Greece is to ratify the deal in parliament after Macedonia has made the necessary changes to its constitution, Mr Tsipras said.
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.
Greek opponents of the deal - which will reportedly rename the Balkan republic as North Macedonia - say it would not go far enough.
Defence minister Panos Kammenos, whose right-wing Independent Greeks party is Mr Tsipras's governing coalition partner, said he would oppose an agreement in a parliamentary vote, meaning the left-wing prime minister will need to seek support from political opponents.
In Skopje, President Gjorge Ivanov said earlier in the day that he remained opposed to a constitutional change that would be likely to be included in the draft deal, to provide an assurance that the name change was permanent and binding for domestic and international use.
European Union and Nato officials welcomed the deal, with Nato's secretary general Jens Stoltenberg saying the "historic agreement" was testament to many years of patient diplomacy.
He urged the two prime minsters to finalise the agreement, saying: "This will set Skopje on its path to Nato membership."
"And it will help to consolidate peace and stability across the wider Western Balkans."
European Council president Donald Tusk tweeted his "sincere congratulations" to Mr Tsipras and Mr Zaev, saying: "Thanks to you the impossible is becoming possible."
EU foreign affairs head Federica Mogherini and Johannes Hahn, commissioner for EU enlargement, said they looked forward to accession negotiations beginning with Skopje in June.