Greek lawmakers are gearing up for a confidence vote in the left-wing government, which lost its parliamentary majority after its coalition partner walked out to protest a deal to normalize relations with neighboring Macedonia, AP reports.

Prime Minister Alexis Tsipras is expected to narrowly survive the ballot at midnight Wednesday, backed by independent lawmakers and deputies from his former coalition partner who propose to defy their party’s line.

Tsipras has strongly defended his efforts to end a 27-year dispute with Macedonia over the country’s name — which Greece says implies claims on its own province of Macedonia and on Greek cultural heritage.

Under the agreement, which Macedonia has already ratified, the country will be renamed North Macedonia, and Greece will lift its objections to the country joining NATO and the European Union.