"I have good news. a while ago we reached an agreement with the Prime Minister of the Former Yugoslav Republic of Macedonia on an issue which has been on our minds for many years", Mr Tsipras told Greek President Prokopis Pavlopoulos during a televised meeting.
Bulgaria, which also shares a border with Greece and Macedonia, said the new name should not be used for territorial or claims concerning language, culture, history or identity.
Ancient Macedonia was the cradle of Alexander the Great's empire, a point of pride to Greeks today.
The row has stymied Macedonian attempts to join the European Union and the North Atlantic Treaty Organisation military alliance in a region where the two organisations jostle for influence with Russian Federation.
Macedonian Prime Minister Zoran Zaev said on May 19 that the name of the "Republic of Ilinden Macedonia" could be a possible compromise to be reached between Skopje and Athens in a dispute over the name of the country.
Previous administrations in Macedonia's capital, Skopje, resisted demands to change or modify the name.
The United Nations envoy who has tried to mediate the name dispute between Greece and Macedonia for almost as long as the dispute has existed is congratulating the countries' prime ministers for resolving their differences.
However, the accord still requires ratification by the two national parliaments and a referendum in Macedonia.
"In other words, if the constitutional amendment is not successfully completed, then the invitation to join North Atlantic Treaty Organisation will be automatically rescinded and the accession talks with the European Union will not start", he said.
Nato Secretary General Jens Stoltenberg added: "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".
'I am keeping my fingers crossed, ' he said. Tusk said: "Thanks to you the impossible is becoming possible", he said.
The new name will need to be approved by the Macedonian people and the Greek parliament, but by the sounds of things it's a goer.
The two prime ministers are expected to sign the agreement over the next weekend.
Veteran United Nations diplomat Matthew Nimetz, who has been a mediator in the name dispute since 1994, hailed the "leadership, vision and determination" of the foreign ministers of Greece and Macedonia, who have negotiated for months.
Hristijan Mickoski, president of Macedonia's opposition party VMRO-DPMNE, said: "Today is a hard day for the Republic of Macedonia".
Greek opponents of the deal say it would not go far enough.
As it happens, Greece also has a region called Macedonia.