“These elections can spearhead a profound change—a democratic revolution,” predicted Ada Colau in early May. Her words recalled the historic municipal vote in 1931 that sent the king packing and turned Spain into a republic overnight. Three weeks later, history repeated itself: Colau, the face of Spain’s anti-eviction movement and a tireless campaigner against austerity, won Barcelona’s elections and will become the city’s new mayor.

Something very similar occurred in Madrid. Manuela Carmena, a retired judge who is also known for her anti-eviction work—as well as for her underground activism as a labor lawyer during the Franco years—came in a close second in the capital’s municipal elections. On the verge of an agreement with the Spanish Socialist Workers’ Party (PSOE), she is the favorite to wrest the town from a quarter-century of conservative rule by the so-called Popular Party (PP). This time around, the municipal vote ousted not a king but “the Countess”: right-wing icon Esperanza Aguirre, who’s come to embody the arrogance of a quasi-aristocratic political class that has outstayed its welcome.

Led by Spain’s two largest cities, the local and regional elections on May 24 have changed the country’s political landscape beyond recognition. A left-wing tide has swept across municipalities from Valladolid to A Coruña and regions from Castilla-La Mancha to Valencia. The unprecedented rise of new parties—Podemos (“We Can”) on the left, Ciudadanos (“Citizens”) on the right—means that cities and regions will no longer bow to the absolute majority rule of either the PP or the PSOE, the two parties that have dominated Spanish politics for the last 30 years.

Instead, coalition governments will be the new norm. Now more than ever, parties will have to negotiate with one another to build governing majorities. This will take some getting used to in a political culture that has never been strong on dialogue and that tends to equate compromise with defeat. The looming national elections this fall will not make the negotiations any easier.

The reason for Spain’s leftward shift in these elections is clear: Neither of the two major parties has adequately responded to the Great Recession, which hit Spain harder than most other countries in Europe. The PSOE government, in power when the crisis first hit, buckled to European Union–imposed austerity measures and even changed the Constitution to prioritize debt payments over social spending. The PP, which won the 2011 elections with an absolute majority, then cranked austerity up a notch, combining relentless cutbacks with a massive privatization of public services. Poverty and unemployment rates soared, while evictions and emigration hit all-time highs—as did income inequality. The PP today points to macroeconomic figures to tout Spain’s steady “recovery”—driven by an uptick in low-paying temporary jobs—but most Spaniards have yet to notice any improvement in their lives.

Compounding the problem are the endless revelations of widespread corruption at all levels of government, primarily (but not only) involving the PP. Many voters see an obvious connection between the country’s deep-seated political and economic ills and a two-party system that allows a class of professional lawmakers to serve a lifetime in public office. Far removed from ordinary citizens, they cozy up to the banks and corporations through a well-established system of backroom deals, kickbacks, and revolving doors, while excluding the voters themselves from the political process.

Podemos’s bet was to convert the mounting outrage over this state of affairs—expressed by the thousands of indignados who took to the streets in 2011—into political power. Over the past year, Podemos has managed to reinvigorate an apathetic left, rekindle the dormant idealism of many PSOE voters uncomfortable with the party’s steady rightward drift, and politicize large swaths of Spanish youth just as they are reaching voting age.

Ciudadanos, the other party challenging Spain’s political establishment, has been touted by conservatives as the answer to Podemos. Boosted by media support, Ciudadanos has successfully appealed to the center despite its hard-line stance on immigration and abortion, and despite revelations about its candidates’ past connections to the PP and to neofascist groups. The PP, meanwhile, has lost nearly 2.5 million votes, scores of local and regional representatives, and some of its longstanding strongholds, such as Valencia and Madrid. Prime Minister Mariano Rajoy has even been censured by PP members for the party’s dismal performance—a rare occurrence in a hierarchical organization that prides itself on internal discipline. “Mr. President, look in the mirror and take responsibility for yourself,” said the PP’s Juan Vicente Herrera, president of the Castile and León region, following the elections.

Using a broad brush to paint itself as the “top political force of the left,” the PSOE has attempted to paper over its loss of almost 700,000 votes since the 2011 municipal and regional elections, and some 2 million votes since 2007. Rhetorical positioning aside, the party will have to negotiate with Podemos in most regions, from Extremadura to Castilla-La Mancha, in order to lead by coalition. It’s a strategy that, so far, has failed miserably in Andalusia, the party’s linchpin state, where the elections were pushed forward to March 22. There, Susana Díaz, the PSOE leader, failed to win a historic third vote of confidence on May 14 and may soon have to call new elections, giving Podemos a chance to regroup and vie for an even larger slice of the electoral pie.

“You don’t take heaven by consensus,” Pablo Iglesias proclaimed at the Podemos Citizens’ Assembly in October, echoing Marx’s famous phrase about the Communards. “No, you take it by storm!” This kind of idealism has perhaps spawned Podemos’s biggest challenge to date: managing outsize expectations and their counterpart, all-too-easy disenchantment. Compared with the polling six months ago, which had Podemos as the country’s leading party, the third-place finish that it achieved in most regions might seem disappointing. “The artificial inflation and deflation of expectations is one of the establishment’s strategies against us,” says Ariel Jerez, a member of the party’s Citizens Council, “something with which, sadly, the media has gone along.”

The next months will prove crucial for Podemos’s chances in this fall’s national elections. Having won five seats in the European Parliament last year and 15 in the Andalusian elections in March, it now has 134 representatives in autonomous parliaments and hundreds more on the over 8,000 city councils across Spain. This presents an organizational challenge for the fledgling party, but also an opportunity to finally effect real political change. The agenda at the local and regional levels will include a push for transparency, auditing and restructuring the public debt, mortgage relief, and more progressive taxation, as well as investments in education, research, and development to reverse the country’s brain drain. The party will also work to institute various forms of direct democracy, including citizen-initiated legislation, referendums, and a “citizens’ seat” in each parliament.

Podemos has to decide soon whether it will enter the national elections by itself or as part of a progressive bloc. It entered the regional elections by itself, coming in third in most places—behind the PP and PSOE, but ahead of Ciudadanos. For the local elections, Podemos supported Colau in Barcelona and Carmena in Madrid, but only through entering into coalitions with groups like Ganemos and Equo. Forging these partnerships across different political cultures and traditions was a process fraught with tension and doubt, but in cities across Spain, the experiment clearly paid off.

Podemos’s success at the national level will depend on its ability to govern locally. But its future will also hinge on what happens beyond Spain’s borders, particularly in Brussels and Athens. Since January, the European tide has turned. The victory in Greece of Syriza—like Podemos, a leftist party firmly opposed to austerity and corruption—has been a double-edged sword. On the one hand, Syriza’s success belied the doomsayers who predicted a massive economic and political disaster. On the other, changing the course of EU economic policy has proved harder than imagined.

Even if a major victory remains out of reach this fall, Podemos will have gained a strong foothold from which to push for change. The fact that the party proved strongest where it joined forces with others and stuck to its activist roots should help more clearly define the road ahead. Still, rather than relying on Marx’s “taking heaven by storm,” the party will have to return to its favorite Marxist, Antonio Gramsci, who argued in the Prison Notebooks that revolution in modern democracies requires a “war of position”—in other words, patience.