EPA Spain heads for coalition impasse The elections signal the end of two-party domination by the Popular Party and the Socialists.

MADRID — Spain is set for a period of difficult coalition-building after Sunday’s elections in which Prime Minister Mariano Rajoy's conservatives came first, but were far short of a majority and with no obvious coalition partner after the centrist Ciudadanos (Citizens) did worse than expected, finishing fourth.

With 99.6 percent of votes counted, Rajoy's Popular Party had 123 seats in the 350-seat national parliament, way beneath the 186-seat majority they secured in 2011.

The Socialists (PSOE), who have alternated in power with the PP for nearly four decades, were second with 90 seats, while far-left Podemos (We Can) had 69 seats — including the regional coalitions they have forged in Catalonia, Galicia and Valencia — and the centrist Ciudadanos came fourth with 40.

"We are about to begin a period that won't be easy," said 60-year-old Rajoy, who was first elected in 2011 and has earned the approval of the euro zone's most powerful country, Germany, for tightening the reins on Spain's spendthrift economy..

However, his PP did not win enough votes to form a center-right majority with Albert Rivera's Ciudadanos — whose rapid growth, especially in a regional election in their Catalan homeland in September, had promised a better result than fourth place — while a leftist coalition between the PSOE and Podemos would also fall short of a majority.

"I am going to try to form a government and I think Spain needs a stable government," the conservative prime minister told cheering PP followers in Madrid, adding: "Spain needs stability, safety, certainty and confidence."

Spain's parliament now appears fairly evenly divided between the center right, represented by the PP and Ciudadanos with a combined 163 seats, and the center left represented by the PSOE, Podemos and another leftist party, Izquierda Unida, with 161. The remainder of the seats are held by regional parties, who will be crucial to the process of building a coalition government.

That could result, for example, in a leftist coalition including pro-independence regional parties from Catalonia who have been promised a referendum on independence by Podemos leader Pablo Iglesias.

However, PSOE leader Pedro Sánchez is committed to Spanish unity and has categorically ruled out a vote that could allow Catalonia to split with the rest of the country.

Time to talk

Sánchez said the election campaign saw "a coalition of interests trying to make the Socialist Workers Party disappear, but they haven’t succeeded.”

He acknowledged the PP's victory and said it would be Rajoy's job to try to form a government, adding: "The PSOE is ready to debate and dialogue."

"Today a new Spain is born" — Pablo Iglesias, Podemos.

The elections signal the end of two-party domination by the PP and PSOE, with Podemos — which did not exist at the time of the last elections, in 2011, and was founded only in 2014 — and Ciudadanos both taking seats in the national parliament for the first time and bound to have an important role in the formation of Spain's next government.

Spain has never had a 'grand coalition' government of right and left, like German Chancellor Angela Merkel's alliance of her own conservatives and the Social Democrats.

The new challengers, Podemos and Ciudadanos, have campaigned on a promise to end the hegemony of the corruption-tainted established parties and, in different degrees, to reverse the cutbacks that Rajoy has implemented to pull Spain out of an economic crisis that led it to seek a bailout for its banking system.

The economy is now on a path to recovery, but Sunday's election results suggest that the high unemployment rate — still 21 percent — is more prominent in voters' minds than economic growth which hit 3.4 percent year-on-year in the third quarter, which is way above the eurozone average and follows five years of stagnation and decline.

Podemos, which grew out of popular protests against the austerity drive, was seen as the clear winner of the night, performing well above what polls had forecast. Its 37-year-old leader, political lecturer Iglesias, softened his tone during the campaign in order to appeal to moderate Socialist voters.

“Pedro Sánchez's Socialist party got its worst-ever election result since democracy [returned] and the Popular Party got its worst result since 1989," a triumphant Iglesias told supporters, adding: "Today a new Spain is born."

Ciudadanos was formed in Catalonia in 2006 and launched on the national stage in 2014, later gaining huge momentum from coming second in Catalan regional election in September.

Rivera, its photogenic 36-year-old leader, said his party would be "the political axis of a new transition" and would be ready for dialogue with all moderate political forces. However, he did not mention specific coalition options.

This article was updated throughout with the party leaders' comments.