June 17 (UPI) -- Macedonia signed a deal with Greece Sunday to change its name and move toward ending a dispute between the two countries spanning 27 years.
Greek Prime Minister Alexis Tsipras called the signing of the agreement, which will rename Macedonia as the Republic of Northern Macedonia, "a brave, historic and necessary step for our peoples."
Greece had argued Macedonia was attempting to make a claim on the northern Greek province of the same name by adopting the name after the break-up of the former Yugoslavia.
In signing the agreement on Sunday Tsipras noted the neighboring countries had struggled with "the poison of chauvinism and the divisions of nationalist hatred" for too long.
"We are here to heal the wounds of time," he said.
Macedonian Prime Minister Zoran Zaev said both countries want peace and will move forward as partners and allies, as Greece agreed to lift its vetoes against Macedonia joining the European Union and NATO in exchange for the country changing its name.
"We are proud of today's agreement," said Zaev. "May we stay as forever united as we are on this day."
Macedonia will still have to make about 150 changes to its constitution and the agreement must be approved by the parliaments of both countries before it can go into effect.
Nationalists in both Greece and Macedonia have opposed the deal and Macedonian President Gjorge Ivanov said he would refuse to sign the agreement if passed by parliament.
If turned down by Ivanov, the agreement would be sent to parliament for a second vote and Ivanov would be obliged to approve the legislation if it passed a second time.