Mariano Rajoy
Spain's prime minister Mariano Rajoy casts his vote in the general election on 20 December Reuters

There is uncertainty in Spain after initial results show the incumbent prime minister Mariano Rajoy and his conservative Partido Popular party have won the most seats in the general election but will have to form a coalition to stay in power.

With almost all votes counted, the Popular Party (PP) got 123 seats; the Socialists 90 and the anti-austerity Podemos party 69 while the liberal Ciudadanos party was in fourth place with 40 seats.

Rajoy's party will fall well short of the 176 required for a majority and it is his party's worst result in a general election, as the country grapples with recession and high unemployment.

The results suggest at least three parties would have to join to form a coalition government and none of the main combinations predicted before the vote would reach an absolute majority, Reuters reported.

Policy analyst at the Open Europe think tank Vincenzo Scarpetta told IBTimes UK that there will be considerable uncertainty in the coming weeks as the horse-trading among the parties commences.

"I think Rajoy will claim the right to form the government because he is leader of the party with most seats, but it is not obvious how he will muster a majority," he said.

"We have a fragmented parliament which is what we were expecting but what we were not expecting is that there is no obvious majority. The only combination would be a grand coalition but that is unviable in Spain. The uncertainty right now is pretty much total."

Podemos' surge has shifted politics in Spain to the left with five left-wing parties led by the opposition Socialists and Podemos getting 175 seats.

However an alliance among them could be difficult as they disagree on economic policy and the degree of autonomy that Catalonia should get.

Vincenzo Scarpetta from Open Europe said: "The way it looks right now, at best, Spain gets a weak government, at worst if no government can be formed, Spain might have to head to the polls again. No one can be the kingmaker because no one has enough seats."

A pact between the PP and Ciudadanos would get 174 seats under a best case scenario, just below the 176 mark of the absolute majority.

An alliance between the Socialists, Podemos and the former communists of Izquierda Unida would get 169 seats at best, although they could potentially attract a further 15 seats from smaller leftist regional groups.