MADRID (AP) – Spain´s newly elected Parliament voted Thursday by a majority to elect a Socialist candidate as chamber speaker, breathing some life into acting Socialist Prime Minister Pedro Sánchez´s aspirations of forming another leftist government.

The crucial vote was won by Francina Armengol with 178 votes in the 350-lower house of parliament, against 139 for the main conservative Popular Party´s candidate.

It was the first parliamentary vote since inconclusive national elections on July 23 left no group with an easy path to form government. Parties on the left and right have almost an equal number of seats.

It remains to be seen if Sánchez can round up the same support should he be called on by the king to try to form a government. If not, a new election could be around the corner.

The parliament was also to vote on eight members of the speaker’s presiding council, a body that sets the agenda for parliamentary sessions.

Armengol won with the support of 14 votes from two separatist parties in the northeastern region of Catalonia, including seven from Junts (Together), a radical Catalan separatist party led by fugitive politician Carles Puigdemont, who resides in Brussels after fleeing Spain following his unsuccessful 2017 secession bid.

Junts were quick to point out that the vote was solely for the speaker position and did not indicate the party would back Sánchez.

If it did, Puigdemont, who faces criminal charges in Spain, would be in prime position to determine the course of Spain´s politics for the next four years, making it a constant cliff-hanger of a legislature.

Besides Junts, Sánchez´s Socialists, the center-left Sumar (Joining Forces) and four smaller parties total 171 seats. The Popular Party, which received the greatest number of votes in the election last month, the far-right Vox party, and one smaller party can also muster the same 171 seats. To get an absolute majority, 176 votes are needed.

The defeat for Alberto Núñez Feijóo’s Popular Party highlighted its isolation in the chamber. This is mainly owing to its numerous pacts in regional and town hall governments with Vox, a party that is viewed as toxic by other groups in Parliament but which is the country’s third political force.

But Puigdemont’s views are also politically explosive for most Spaniards.

The former regional president of Catalonia wants Spain´s incoming government to guarantee it will help hundreds of separatists facing legal problems for their part in his breakaway bid.

He also wants Madrid to authorize a referendum on independence for Catalonia.

The referendum is a non-starter for Sánchez and his conservative rivals. Sánchez, however, has pardoned high-profile separatists and reformed laws to give some legal relief to separatists as part of his agenda to lower tensions in Catalonia.

The next hurdle to forming a government will come in the following days when King Felipe VI begins his consultations with the leaders of the different parties to see who has the best chance to form a government. If that candidate fails to secure the backing of Parliament, then a two-month countdown starts, after which new elections would be triggered.