Macedonia's parliament on Friday voted to start the process of renaming the country North Macedonia, a major step towards ending a decades-long stalemate with Greece and opening a door to NATO and the EU.

The razor-thin majority was reached after a tense week of debate and back-room negotiations in Skopje, where it was unclear until the last moment whether the government could secure votes from two-thirds of parliament.

Amendments will now be drafted to incorporate the new name into the constitution, after which another parliamentary vote will be required to enshrine the changes.

"I can confirm that with 80 'yes' votes the parliament adopted the proposal by the government to start the procedure to change the constitution," said Talat Xhaferi, speaker of the 120-member assembly.

Although more legislative hurdles await, it is a crucial victory for Prime Minister Zoran Zaev, who had to win over several MPs from the right-wing VMRO-DPMNE party that has been staunchly against the deal.

Under the accord, which Zaev struck with his Greek counterpart in June, the Balkan state would rename itself North Macedonia in exchange for Athens' promise to stop blocking its entry into NATO and the EU.

Greece has stood in Macedonia's way for 27 years in protest at the country's name, which it argues is an encroachment on its own province called Macedonia.

Macedonian critics of the deal have slammed it as an embarrassing concession to Athens.

But enough of VMRO-DPMNE's MPs were eventually persuaded to break ranks with the party leadership.

"I want to say thank you to every MP and especially to the MPs from VMRO-DPMNE who put the state's interests above party and personal interests, despite the unnecessary pressure over them," Zaev said after the vote, adding that he would "guarantee" their safety.

US, EU support for name change

Among the 'yes' voters were three VMRO-DPMNE politicians who were granted bail from house arrest this week.

They are facing trial for their alleged involvement in a bloody mob attack on parliament on April 27, 2017, when nationalist supporters of VMRO-DPMNE stormed the assembly and injured scores, including Zaev.

The Prime Minister refused to say Friday whether there had been any negotiation for their eventual amnesty.

"I personally forgive everyone," he told reporters, reiterating a call her made earlier in the week for "reconciliation" over the incident.

He also denied an accusation from VMRO-DPMNE that his government had offered bribes for votes.

In recent weeks US and EU officials have voiced strong support for the name-change deal, pitching it as a once-in-a-lifetime opportunity for Macedonia to cement an alliance with the West.

"A great day for #democracy in #Skopje!" EU enlargement commissioner Johannes Hahn tweeted after the vote.

"I expect that the free choice of all MPs is fully respected, especially of those who crossed the aisle tonight," he added.

'Crudest interference' 

Russia and the US have traded allegations of interfering in Macedonia's affairs.

Last month Washington accused Moscow of running a disinformation campaign to sour the public on the deal ahead of a referendum on the changes.

On Thursday Russia, which opposes Macedonia's NATO aspirations, fired back.

"There is a continuation of the crudest interference of the US and EU in Skopje's internal affairs, the level of which has already surpassed conceivable boundaries," the Russian Foreign Ministry said in a statement on Thursday.

It mentioned a letter that US Assistant Secretary of State Wess Mitchell sent to VMRO-DPMNE leader Hristijan Mickoski this week, saying he was "disappointed" with the party's stance.

Foreseeing a rocky road towards securing the necessary parliament votes, Zaev's government organised a "consultative" referendum on September 30, in hopes that strong public approval of the new name would make it difficult for VMRO-DPMNE to kill the deal.

While more than 90 percent of those who voted approved the name-change the low turnout, in part because of opposition's calls for a boycott, undermined the result.

If the name change is approved, Greek parliament will then need to ratify the deal to finalise it.

Greek Prime Minister Alexis Tsipras congratulated Zaev after the vote Friday, writing on Twitter: "Tonight's vote is a big step towards our common success."