Greek Prime Minister Alexis Tsipras survived a no-confidence motion in parliament on Saturday, setting the stage for the signing of a historic accord with neighbouring Macedonia to settle a long dispute over its name.

The motion brought by the opposition New Democracy party was rejected by 153 MPs, with 127 in favour. Opposition had accused Tsipras of making too many concessions over the deal, due to be signed on Sunday.

Thousands of Greeks protested outside parliament against the accord with Macedonia, calling for Tsipras to resign. Police used stun grenades and tear gas to prevent them from entering the building. "This is a deal I believe that every Greek prime minister would want," Tsipras told the chamber earlier.

Had he lost, the leftist firebrand, elected in 2015 would have had to relinquish his mandate to the country's president, signalling early elections. He is already trailing in opinion polls against New Democracy.

Greece had been in dispute with Macedonia since 1991 over the latter's name, arguing it could imply territorial claims over the Greek province of Macedonia, and an appropriation of ancient Greek culture and civilization.

Under the terms of the accord, the country will be known as "Republic of North Macedonia", and Greece will lift its objections to the country joining the European Union and the NATO military alliance.

The foreign ministers of the two countries will sign the pact at the border lake region of Prespes on Sunday morning. Tsipras and his Macedonian counterpart will be present.

It will still require ratification by national parliaments of both countries, and approval in a Macedonian referendum which is not assured.

Alexis Tsipras addresses parliament on Saturday. Photo: ReutersAlexis Tsipras addresses parliament on Saturday. Photo: Reuters

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.