Madrid: Spain has entered uncharted political territory after Prime Minister Mariano Rajoy​ lost his majority in an election that saw voters shift allegiance to new groups at the expense of the two main parties.

Mr Rajoy's​ conservative People's Party lost a third of its MPs even as it beat its main Socialist Party rivals to take the most votes and earn the first shot at forging a government. With Spanish voters rewarding newcomers from anti-austerity leftists Podemos​ and the liberal Ciudadanos​ party, who between them took 109 seats in the 350-member parliament, no clear governing majority emerged from Sunday's ballot.

'Yes we can'. A supporter of anti-austerity party Podemos. Credit:Getty Images

"The field is really open," said Pablo Simon, a political science professor at Carlos III University in Madrid. "We are heading for very long negotiations since the two blocs are virtually tied."

Spain joined a global backlash against establishment politics as voters opted to challenge a two-party system that has seen the People's Party and the Socialists alternate in power for the past 33 years. The splintering of political sentiment leaves no one party in a position to govern, risking instability and a market backlash.