THE smiles were mostly forced. After the counting was over in Spain's municipal and regional elections on May 24th, the conservative Popular Party (PP) of Mariano Rajoy, the prime minister, proclaimed it was still Spain's favourite—yet it won just over a quarter of the vote. The opposition Socialists (PSOE) of Pedro Sánchez claimed to have launched a comeback, but their total vote was also down from previous elections, and they were beaten by the PP almost everywhere. Even the new left-wing radicals of Podemos, who had planned to dislodge the main parties, looked pained after being relegated to third place. The upstart liberal party Ciudadanos was pleased to win seats in regional parliaments and town halls for the first time, but fell short of predictions that it would become Spain's new king-maker.

The real winner was uncertainty. The elections were billed as the latest test of the idealistic new parties that have sprouted across southern Europe in the wake of the euro crisis: Spain's Podemos and Ciudadanos, Greece's Syriza, Italy's Five Star Movement. Tired of corruption, austerity and self-serving political elites, Spaniards upended the two-party system that has dominated the country since democracy was reinstated in 1978. But now they must live with the result: a fragmented political landscape. As in Italy and Greece, the new parties have brought as much confusion as energy.

There are few jurisdictions left where a single party will be able to govern alone. In Spain's previous regional and municipal elections, the two main parties combined accounted for 65% of the vote; this year the PP took 27% and the PSOE 25%. The decline would have been steeper had Ciudadanos fought for more town halls, and had Podemos decided to run candidates under its own brand rather than backing a mosaic of ad-hoc “popular unity” groups. Most of the 13 regional governments chosen on Sunday, and the country's key town halls, will need two parties to reach agreement, and some will need three or more. A new culture of political pact-making must be forged, with the newcomers proving they can do more than snipe from the sidelines.

The greatest changes came in Spain's two biggest cities, which both look set to be governed by broad, Podemos-backed “popular unity” groups. Ada Colau, a former housing-rights activist, will probably become mayor of Barcelona. In Madrid, Manuela Carmena, a 71-year-old former judge who co-founded a group of left-wing lawyers in the 1970s (five of whom were assassinated by far-right gunmen), appeared to have ousted the PP. But both need to find coalition partners, with Ms Carmena leaning on the Socialists while Ms Colau manages an unwieldy array of smaller backers. Their victories can be seen as triumphs for the anti-austerity indignado movement that took over town squares in 2011, and which inspired Podemos and the “popular unity” candidacies. Madrid and Barcelona will become the experimental laboratories for a new form of radical left-wing politics, featuring direct internet-based democracy and so-called “citizens' bail-outs” of those who have suffered most from Spain's economic woes.

Because the insurgent parties are so fragmented, it is not clear what their gains will mean for government policy. Voters clearly rejected the entrenched corruption of Spain's mainstream parties, and they want government to address the economic desperation of Spain's poor and unemployed. (While the economy has returned to growth, the unemployment rate remains over 23%; over 12% have been unemployed for a year or longer.) Ms Colau and Ms Carmena have proposed policies at the local level, such as ending house evictions and blocking further privatisation of government services. But without a unified party platform, it is hard to perceive a broader Podemos strategy. And it is hard for Podemos to claim a national mandate when so many voters picked Ciudadanos, who are in many ways their ideological opposites.

The next contest will come in Catalonia, which will vote for its regional parliament in September in a battle coloured by demands for independence. Meanwhile, months of coalition bargaining await in the regional governments where much of Spain's public spending is done. The upstart parties may be reluctant to make compromises as they look towards the general election that is due by January. The obvious alliances, at both the regional and national levels, are between PP and Ciudadanos or between PSOE and Podemos. But the upstart parties' supporters chose them in protest against the old dinosaurs, and will not welcome such pacts. If idealists were looking to Spain's elections for a message about the future of politics, the message seems to be that it will still involve cutting deals.