Spain’s December election outcome has put the country in political limbo. With no conclusive winner and no possibility of a coalition government, Madrid’s current rulers have become a caretaker government with no end in sight.

This scenario would be a libertarian’s dream except that, in the context of the country’s mounting constitutional and institutional challenges, the impasse could devastate the European Union’s fourth-largest economy and stoke up extremism in neighbouring countries.

The governing centre-right Popular Party lost its parliamentary majority in the elections, while the Socialists, the other national force, suffered their greatest losses since Spain moved toward democracy in the 1970s. What accounts for their reversal of fortune? It resulted in part from the recent emergence of two political parties, Podemos and Citizens. Podemos is a radical-left organization that led some of the demonstrations against the 2008 financial crisis and Spain’s corruption scandals.

Citizens is a centre-right party that began as a counterweight to the nationalist push for independence in Catalonia, but has evolved into a national force that also questions a political system favouring the two major parties and crony capitalism.

The protest vote was not enough to catapult the two new organizations into government, nor has it given the Popular Party the numbers that would allow it to govern in coalition with the Citizens party – or the Socialists enough seats in parliament to form a government with Podemos. The left-wing alliance would need the support of separatist regional parties, anathema to some key leaders in the Socialist Workers’ Party. Even so, 43 days after the inconclusive election, the king has asked the Socialist Leader, Pedro Sanchez, to try to form a government given that the sitting Prime Minister, Mariano Rajoy, has acknowledged he is not in a position to obtain enough support in congress to renew his mandate.

The electoral impasse also has other causes. In recent years, the financial crisis and the corruption scandals led millions of Spaniards to question the accepted legacy of Spain’s transition to democracy, from the monarchy to the constitution to the territorial integrity of the country. This sentiment has subsided somewhat, but not enough to produce a viable alternative. At the same time, voters who want to preserve the institutional pillars of the country’s successful modernization of the past few decades no longer command enough strength to guarantee stability.

The consequences of Spain’s predicament are potentially devastating for the economy. After some tough free-market measures, including the partial liberalization of the labour market, growth had returned – GDP grew more than 3 per cent last year and unemployment fell at an annual rate of 8 per cent, almost the same rate that joblessness was increasing when Mr. Rajoy took over in 2011. It is hard to understate the stakes for a country derided until recently as one of the hopeless PIGS (Portugal, Ireland, Greece and Spain) that threatened to bring down the EU construct, but was starting to be seen as a miraculous turnaround that could inject some energy back into the stagnant union.

Perhaps more damaging than the economic reversal that Spain’s political chaos could cause is the challenge to the constitution coming from the nationalists in Catalonia. A group of parties that won less than 50 per cent of the vote in regional elections has formed a government with the help of an extreme-left party promising to bring about independence, in a matter of months, against the wishes of the popular majority of Catalonians and of Spain as a whole.

The government’s weak effort to win back support for the constitution through political reform, and the debilitating effect of the corruption scandals, give the impression that the nationalists are profiting from the current turmoil and moving their agenda forward by leaps and bounds. In the absence of effective actions by the sitting (sort of) government, another risk comes from the extreme right.

If no government can be formed soon, new elections must be held. It is impossible to predict how Spanish voters would vote. Anything is possible, including a government dependent on an extreme-left party that foments separatism in various regions or a centre-right coalition that gives life back to a moribund political system. When the range of options is that wide, economic producers tend to take one step back and political hotheads one step forward.