The Greek government has spent 27 years fighting with Macedonia over the use of the name, which references ancient Macedonia and by association its famous leader, Alexander the Great. Protesters this spring called for a United Nations resolution demanding recognition of the country under the name of Macedonia.
Zaev said the deal would be signed this weekend, and a voter referendum would be held in the fall. Tsipras was widely expected to give a state address later in the day.
Greece regards "Macedonia" as a term referring only to one of its northern regions and the ancient Kingdom of Macedonia, and insists on the use of another name for its northern neighbor.
Ancient Macedonia was the cradle of Alexander the Great's empire, a point of pride to Greeks today.
"The chance is here and it must be seized, bravely, as this is the only patriotic way", Macedonian Prime Minisrter Zoran Zaev told a press conference in Skopje.
A resolution of the dispute would see Greece lift objection to Macedonia's accession to North Atlantic Treaty Organisation.
But before that, he said the agreement will be put to parliament for ratification in order not to waste any time and to allow Greece to lift its blockade on Macedonia's potential membership of North Atlantic Treaty Organisation and the EU. However, Tsipras said, this will be contingent on Macedonia completing the constitutional changes. "I am keeping my fingers crossed".
European Union foreign affairs chief Federica Mogherini and commissioner Johannes Hahn issued a joint statement congratulating the two prime ministers "in reaching this historic agreement between their countries, which contributes to the transformation of the entire region of South-East Europe".
However, both prime ministers faced dissent at home. The new name will be used both domestically and internationally, with Macedonia making a relevant amendment to its Constitution, Zaev added. Tsipras said that Athens got "a good deal which covers all the preconditions set by the Greek side" as he briefed Greek President, Prokopis Pavlopoulos, on the results of negotiations.
Mironski contributed from Skopje, Macedonia.