Greek left-wing Prime Minister Alexis Tsipras won a vote of confidence on Wednesday, clinching the support of 151 lawmakers in the 300-seat parliament.

The result meets the threshold that he had set to avoid calling an early election. It also paves the way for parliament to ratify an accord agreed to last year with Skopje to end a long dispute over Macedonia’s name.

The Greek PM called the confidence vote on Sunday after the resignation of right-wing coalition junior partner Panos Kammenos of the right-wing Independent Greeks party. Mr Kammenos resigned as a sign of protest over the accord. The vote was called after the country had plunged into political turmoil fuelling speculation about possible elections.

The vote of confidence means that the minority government can potentially stay in power until the end of its four-year term in October.