Greek legislators have ratified an agreement to end a near three-decade dispute over neighbouring Macedonia's name in a landmark vote intended to clear the small country to be renamed North Macedonia in its quest for Nato membership.
The deal passed with 153 votes in the 300-member Greek parliament, two more than needed. It had faced fierce opposition and cost prime minister Alexis Tsipras his parliamentary majority after a right-wing partner in the governing coalition quit in protest.
Mr Tsipras's left-wing Syriza party holds 145 seats in parliament. Independent legislators provided the votes needed for ratification.
Under the deal, Macedonia changes its name to North Macedonia and Greece will drop its objections to the country joining Nato and eventually the European Union.
The vote came after three days of acrimonious parliamentary debate and numerous street protests, some of which turned violent.
Scores of protesters who braved torrential rain and driving wind outside parliament chanted "traitors" as the legislators voted inside.
Greece has long argued that use of the name Macedonia implied territorial claims on its own northern province of the same name. The issue has been contentious for decades and has whipped up nationalist and patriotic sentiment in both countries.
Opposition was particularly fierce in the northern Greek region of Macedonia, which borders the former Yugoslav republic that claimed the same name after declaring independence in 1991.
Critics claimed the deal signs away their identity and a cultural heritage dating back to Alexander the Great more than 2,300 years ago.
More than 150 people have been detained for questioning since Thursday following violence at demonstrations against the deal in Athens and two towns in northern Greece. Most were released without change.
At least two legislators from the governing Syriza party have said their homes were targeted by violent demonstrators, while another was targeted in a firebombing which caused no injuries.
Greece's tourism minister, an independent conservative who supports the government, said she had received multiple death threats.
Nato secretary-general Jens Stoltenberg welcomed the ratification, saying in a tweet that the vote is "an important contribution to the stability and prosperity of the whole region".
He added: "I look forward to the future Republic of North Macedonia joining Nato."