Spanish voters dealt a blow to the country's political establishment and fell short of giving outgoing prime minister Mariano Rajoy directions on what colour of coalition government he should pursue as leader of the largest party.

Rajoy's centre-right Partido Popular (PP) and its historical competitor, the socialist PSOE, lost, respectively, 63 and 20 seats in the 350-seat lower house of parliament on Sunday (20 December).

Student or retired? Then this plan is for you.

Rajoy: 'Spain needs a stable government' (Photo: Pool Moncloa)

PP emerged as the official winner with 123 seats, but the real winners are two newcomers, unrepresented in the national parliament before Sunday: The left-wing anti-austerity party Podemos won 69 seats, while centre-right Ciudadanos won 40 seats.

“Today a new Spain is born, a Spain that has ended the political system of turns,” said Podemos leader Pablo Iglesias, referring to the de facto two-party system which Spain has had since the death of its fascist dictator Franco in 1975.

“Millions of Spaniards have decided that Spain is going to change,” said Ciudadanos' leader Albert Rivera.

Rajoy will have to form a coalition if he wants to continue his rule, but it will not be easy.

The PP and Ciudadanos did not receive enough votes together for a centre-right bloc. They will need the additional support from at least two smaller parties.

Even then, it would mean forming a coalition with one of the separatist parties from Catalonia or from the Basque Country - something which seems unlikely after Rajoy's recent legal fight against the Catalan independence movement.

Parties not willing to co-operate

But despite Podemos' spectacular win, a left-leaning coalition is equally difficult. It would also require the socialists and Podemos to embrace two of the smaller parties, unless Ciudadanos is willing to switch sides.

The only government combination that can enjoy the support of just two parties, would be a grand coalition of Rajoy's PP with the socialists.

The mathematically possible configurations do not reflect the political facts, however. Not all parties are willing to work together, while great differences exist over the future of the country and whether or not to continue with austerity programmes.

Ahead of the elections, Rivera, for instance, had said he does not want to sign a deal with either the PP or the PSOE.

Rajoy already announced he would take the lead.

“Whoever wins the elections has the obligation to try to form a government, and I will try to do so because Spain needs a stable government,” said Rajoy, adding it will be difficult.

“We will need to talk a lot, but I am going to try,” he said.

For his part, Greek prime minister Alexis Tsipras, who leads a political party which came to power with a similar anti-austerity message, hailed the victory of Podemos.

“Austerity has also been defeated politically in Spain,” Tsipras said according to Kathimerini newspaper.

“Our struggle is being vindicated. Europe is changing,” he added.

At the daily press conference Monday, spokesperson Mina Andreeva congratulated Rajoy on behalf of the European Commission “for having won the greatest number of seats in parliament."

“Despite difficulties, we have good hope that a stable government may be formed so that Spain can continue to work in cloose cooperation with European instititons and the partners of the EU,” she added.