MADRID — In the build-up to Sunday’s election in Spain, news reports clung to the assertions that it would be both unpredictable and an earthquake. Predictably, the result was an earthquake. As polls had long suggested it would, the governing Popular Party (PP) came first. As much rumor had predicted — including one muttered to Angela Merkel by Mariano Rajoy in Brussels earlier this week — the hard-left Podemos came almost second in vote-share, though firmly behind the center-left Socialists (PSOE) in seats. The insurgent liberal party, Ciudadanos, came in fourth after a punishing election campaign. With the final results still trickling in, here is what we know.

1. Rajoy has defied political physics

Spain’s economic and political crisis peaked about halfway through Rajoy’s first term as prime minister and it seems the timing has been favorable to him. While the PP’s vote-share has fallen from 44.6 percent in 2011 to 28.7 percent, that it has remained in the lead is a tribute to slowly improving levels of economic confidence in a country where unemployment remains eye-wateringly high and the memories of “la crisis” remain fresh. The PP has clung on despite shocks that would have destroyed other European governments. If it stays in power it will do so as a minority government, lurching from vote to vote, but in the circumstances, even this is an achievement.

2. Congratulations, Jorge y Soraya

That achievement is as much down to the unpopular Rajoy’s two closest lieutenants as it is to him. The first of the duo is his campaign director, Jorge Moregas. He was the man behind the PP’s concentrated attack on Ciudadanos, whose free-market outlook threatened to sap the governing party’s support in the big cities. By painting Albert Rivera, its leader, as inexperienced and scaremongering about the possibility of Podemos involvement in an anti-PP coalition government, the PP appears to have won back several crucial points in the final weeks of the campaign. This was also thanks to Soraya Sáenz de Santamaría, the PP’s Number Two. The Moregas strategy was to run two presidential candidates: Rajoy would tour small-town Spain exuding old-school authority while Sáenz would concentrate on the big cities as the face of a renewed, young, liberal, modern PP willing to tackle the corruption and abuses of which it had been accused in government. She was the ultimate anti-Ciudadanos weapon and, it seems, she generally succeeded.

3. Ciudadanos could be powerful losers

With 94 percent of districts counted, the PP and Ciudadanos are — when added together — on 162 seats and thus not far off a majority (176 seats) in Spain’s lower house. Though on 40 seats and thus up 40 since the 2011 election, Rivera’s party has underperformed its poll standing of a few weeks ago. Still, it is Rajoy’s preferred — perhaps only possible — governing partner. In the days before the election Rivera committed to letting the largest party govern by abstaining in the congressional vote on the new government. Yet he would seek to exact a price. Following local elections in May, his party has propped up administrations in regional governments across Spain. It has typically demanded that figures associated with corruption go, that primaries be held, and that economic reforms proceed.

At a national level the equivalent could be the symbolically important replacement of Rajoy for Sáenz, the abolition of the Senate (Spain’s upper house, an emblem of the cozy political “casta” and a bastion of the PP) and electoral reform to make the system less favorable to “bipartidismo”, or the two-party, PP-PSOE establishment. Whether Rivera can demand this depends on the final numbers and, specifically, whether the roughly 20 MPs from regional parties (especially those from Catalonia and the Basque Country) can be bought off and thus persuaded to let a PP-led government continue.

4. Fresh elections may beckon

If a deal between the PP, Ciudadanos and small, regional parties cannot be forged, three other options are arithmetically possible: a German-style grand coalition of PP and PSOE, a coalition of anti-PP parties including the PSOE, Podemos and Ciudadanos and a coalition of the left. All look unlikely. To enter a grand coalition would be suicide for the PSOE, its leader Pedro Sánchez loathes Rajoy and the whole edifice would be anathema to Spain’s broadly adversarial political culture. Meanwhile, Rivera has ruled out supporting a government involving Podemos and insisted that the largest party should govern. To support an anti-PP coalition, he would have to demonstrate to his supporters that none of the alternatives were viable and offer enormous concessions. This is hard to imagine. The only other alternative — and the most likely one — would be a deal between the PSOE, Podemos and the smaller, regional parties. This would turn on major constitutional reform possibly including a federal settlement for Spain and the resignation of Sánchez in favour of Susana Díaz, president of Andalusia and a figure more favorable to other parties. Otherwise fresh elections may beckon.

5. Podemos has done well

To support the party of the ponytailed Pablo Iglesias in the past months has been to ride a rollercoaster. Having peaked at around 28 percent in January and plunged to half that just a couple of months ago, Podemos soared through the final weeks of the election. Its final result, some 69 seats in the lower house, is deflated by the Spanish electoral system, which punishes parties outside the old two and those strongest in big cities. Indeed, were seats allocated proportionally, exit polls suggest that Podemos might be ahead of the PSOE. If there is one thing that leftists outside Spain can learn from Iglesias and his gang, it is that it can make sense to configure a political party as a federation of local groups rather than a single, monolithic organization. By franchising left-leaning civil society bodies in Barcelona, Valencia and Galicia (and, less formally, in Madrid), Podemos — a party founded just two years ago — has been national, insurgent and exciting while also possessing local roots.

6. Spain has a new political divide: Old vs. New

Spain is now a country of four main parties. Yet their support is not evenly distributed. In small-town and rural Spain, the old PP-PSOE order lives on. Andalusia remains a Socialist (PSOE) stronghold. Castile and Leon remain a bastion of the PP. Such regions increasingly have something in common: their sturdy loyalty to old parties dogged by corruption scandals and responsibility for Spain’s economic crisis. In big cities like Madrid, Barcelona and Valencia, by contrast, the new parties — Podemos and Ciudadanos — are storming ahead. So Spain is still a country divided (as it has been for so long, and so deeply) between left and right. But it is now a country also divided between old politics and new, between big cities and small.

7. The two-party structure is dead

Following the Franco years, Spain’s democracy was designed to promote the sort of stable — comfortable, even — two-party order that had thus far eluded a country whose politics had long been defined by fragmentation and violent confrontation. This succeeded. But the side-effect of the long-years of PP-PSOE rule, in which the two parties typically took about three-quarters of votes, was to nurture croneyism, corruption and complacency. That has now been blown out of the water. “Bipartidismo,” insofar as the term describes the hegemony of PP and PSOE, is dead. Whether a new two-party order will emerge — perhaps a reformed PP against Podemos — is not yet clear. This turns on the events of the coming weeks: which parties (if any) end up in government and whether the PP, if it continues to lead, is forced to reform the electoral system. The only certainty is change.

8. A puny prime minister

In Spain’s post-dictatorship democracy to date, no party has come first in a national election on under 34.4 percent of the vote (38.8 percent, if you only count the era, since 1982, of PP-PSOE dominance). Yet now the PP has just 28.7 percent. Which begs the question: is it right, in a country where the largest party enjoys unusually strong powers over the legislative process, that an outfit with little more than a quarter of the vote should dominate politics, over parties only slightly less popular than itself, for a full parliamentary term? Whether the election produces serious political reform depends on the constellation of parties, as discussed above, but even if not, Rajoy will be more dependent on forces outside his own than any Spanish leader in generations.

9. More fragmentation in Catalonia

Spain’s election is an interlude in a drama otherwise continuing of its own accord: Catalonia’s bid for independence. In September, elections in the region produced a majority (in seats, though not in votes) for secession. Yet the intervening months have seen it fragment, with the left-nationalist CUP refusing to join with other pro-independence forces in endorsing the centrist Artur Mas as president. If Mas does not do a deal soon, he may have to return to the voters. Yet the results of the general election in Catalonia are bad for him. His CiU (Convergence and Union) having recently split into devolutionists and secessionists, he led the secessionist bit — now named Democracy and Freedom (DiL) — into the vote on December 20. The result was a fall in support as both the ERC (a leftier pro-independence outfit) and Podem (the local Podemos-backed party) soared ahead, particularly in Barcelona. This both weakens Mas’ hand in negotiations with the CUP and makes the prospects for his party worse in any new elections. If there is a glimmer of light for Catalan nationalists, it is that the local success of Podemos strengthens the otherwise independence-agnostic party’s call for a referendum thus far denied by Madrid.

10. The Catalans may be the key

Much of what happens now turns on events in Catalonia. There, any anti-PP deal may be forged. There, any PP-led government may also achieve the numbers it needs. There, any new constitutional settlement might succeed or fail. There, Podemos has attained its most striking success. There, Ciudadanos has its base and is thus most sensitive. The coming weeks will bring wrangling and constitutional debate. It is inconceivable that Spain’s most heterodox, wealthy and European region will not be at the center of what comes next. Stay tuned.

Jeremy Cliffe is The Economist’s Bagehot columnist.