Mariano Rajoy
Spanish prime minister Mariano Rajoy faces a tough test at the ballot box in the Spanish elections Reuters

Spain's Prime Minister Mariano Rajoy would consider forming a grand coalition with the Socialist party if he fails to win an outright majority in the general election as the country goes to the polls in its most unpredictable ballot in a generation on Sunday, 20 December.

Sources from Rajoy's party told the newspaper El Mundo that Rajoy would want the Socialist leader Pedro Sanchez to quit as a pre-condition to any deal.

The newspaper Publico has described the election as "different to any of the elections Spain has held since 1977", with the country emerging from an economic crisis and the possibility of a new constitution being drawn up.

Policy analyst at the Open Europe think tank Vincenzo Scarpetta told IBTimes UK that even with polls pointing to victory for Rajoy's Partido Popular, a lot will depend on the number of seats that each of the other parties, including Podemos (We Can) and Ciudadanos (Citizens party) can win.

Pedro Sanchez
Spain's Socialist Party leader Pedro Sanchez delivers his speech during an election campaign rally in Torremolinos Reuters

"The markets and analysts are betting on the fact that if Partido Popular doesn't win an outright majority, it will reach out to Ciudadanos and strike some sort of deal.

"The parties have some common ground on economic policies so they can work together. Ciudanos has built up support on change.

"There is a lot at stake because if you pitch yourself as the party of change can you really go and back a government led by Rajoy who represents continuity with the past?" he asked.

A lot will depend on the economy. Although unemployment has dropped, it is still high, with one in five out of work, and that figure is as high as 45% among the country's youth.

"The Spanish economy is growing more than the average in the Eurozone but the Spanish GDP is only returning to pre-crisis levels there are still problems of very high private debt and public debt.

"Progress has been made but the economy is not out of the woods yet," Open Europe's Vincenzo Scarpetta told IBTimes UK.

All four parties oppose Catalonia's plans for a unilateral declaration of independence, Podemos is the only one prepared to offer Catalan voters an amendment to the Spanish Constitution so that they can hold a binding independence referendum.

"It is a big issue, there is definitely a share of the Spanish electorate that does care about national unity. So the Catalan issue reverberates across the country," Scarpetta said.

The think tank the European Council of Foreign Relations had predicted that the most likely coalition combination would be one between PP and Ciudadanos, although the charismatic leader Albert Rivera would not support a PP government headed by Rajoy because of the party's poor record on corruption.

An absolute majority requires 176 seats in a parliament of 350, with the PP currently having 186.