Spain’s left-wing parties have beaten the right in the country’s most polarised election in decades. With the Socialist party (PSOE) winning 123 of the national parliament’s 350 seats, and far left Unidas Podemos winning 42, the statewide left combined to take 165 seats.

This trumped the 147 seats secured by the three right-wing parties combined. The Conservative party (PP) took 66 seats, centre right challenger Ciudadanos (Citizens) 57, and the far right Vox 24. The remaining 38 seats went to an array of regionally-based parties across the left-right spectrum.

The result is a huge victory for Socialist leader Pedro Sánchez and a historic defeat for the Conservatives. The ball is now firmly in Sánchez’s court. With the left still falling short of the absolute majority of 176 seats needed in Spain’s 350-seat parliament, Sánchez will need to secure pacts with smaller parties to secure his investiture and make it possible for the Socialist party to govern.

The big question is whether Sánchez will be able to form a viable, stable government with Unidas Podemos and an array of regionally-based parties without the need for the Catalan separatist parties. It was the Catalan parties who triggered these elections in the first place. When Sánchez would not meet their demands for dialogue on Catalan self-determination, they voted against his 2019 budget in parliament, bringing the government down and forcing a vote.

Assuming the support of Unidas Podemos, the PSOE still needs 11 more seats to reach the minimum of 176 needed for Sánchez to win a first-round investiture vote, unless there are some abstentions. The Basque Nationalist Party (PNV) is likely to play ball with its six seats and so too are a couple of small parties in other regions with one or two seats each. But the numbers still don’t quite add up without at least one of the Catalan pro-independence parties, unless Sánchez gets the radical Basque pro-independence party Bildu on side.

A second-round investiture vote only needs a simple majority if it comes to that, but governing effectively thereafter will not be easy without a strong majority. News emerging from Spain in the hours after the vote suggested the PSOE will try to govern alone rather than entering into a formal coalition, which leaves open the door to shifting alliances depending on the legislation once Sánchez’s investiture is secured.

While the maths actually favours a centrist PSOE-Ciudadanos coalition (180 seats), PSOE voters shouting “not with Rivera” outside the party headquarters on election night made it clear they would consider any such pact a betrayal. So would many Ciudadanos voters.

Their leader, Albert Rivera, explicitly vetoed the possibility of any such pact ahead of the election, due to the parties’ contrasting visions on how to deal with the Catalan crisis. Many will have voted for Ciudadanos instead of another right-wing party due to this cordon sanitaire, and Rivera currently looks set to stick to it. His first post-election declarations suggest he intends to continue challenging the PP for the leadership of the right, from the opposition. With 15.9% of the vote, Ciudadanos came very close to the PP’s mere 16.7%.

While the right has declined overall compared to the 2016 elections, it has also fragmented. New far right party Vox has entered the national parliament for the first time, stealing seats primarily from the Conservatives.

With the emergence of this far right challenger in recent months, Spanish nationalism has resurfaced to a degree few would ever have anticipated just a year ago. Vox also pulled the Conservatives and Ciudadanos further to the right as each sought to become the lead party in the right-wing space.

What first sparked the resurgence of right-wing Spanish nationalism was the Catalan independence crisis. Vox argued it would clamp down on the pro-independence movements once and for all, by taking over the regional government and recentralising the Spanish state.

Yet it soon became clear the left-right split was about much more than Catalonia. The revival of Spanish nationalism has gone hand in hand with a resurgence of traditional Spanish right-wing social conservatism. Vox not only targets Catalan separatists and illegal immigrants, but also women’s and LGBT rights.

The extreme right is not, in fact, new to politics in democratic Spain. The traditional conservative PP party has always embraced the full spectrum of right-wing sensibilities, from the moderate right through to the extreme right. Many of those who voted for Vox come from the far right of the PP, having become disillusioned with the latter.

The left has clearly won this vote, but if Sánchez does not quickly secure the necessary support for his investiture, Spain could be faced with weeks or months of yet more political wrangling and paralysis. With regional elections just around the corner in late May, tactical behaviour is set to continue.

Much will also depend on how the weakened and fragmented right composes itself, and how, in particular, the PP will attempt to reinvent itself after its losses.

Of course, as long as Spain remains mired in these domestic dilemmas, any aspirations it may have to play a greater role on the European or global stage will remain frustrated. Some of Spain’s top political analysts have expressed their exasperation at the almost complete absence of Spain’s role in the EU and beyond from any of the electoral debates and discussions, even with European elections just around the corner and at a time of unprecedented challenges to the EU project.

There is a lot hanging on whether the country can better navigate the new reality of parliamentary fragmentation this time around to make progress, within its own borders and beyond.

This article was originally published on The Conversation