Communism or liberty. The slogan of Isabel Díaz Ayuso, the conservative contender in the election for the Madrid regional government, was undoubtedly crass. It was also brilliantly effective. Díaz Ayuso triumphed at the polls this week, doubling the vote share for her People’s party and inflicting a humiliating defeat on Spain’s socialist prime minister Pedro Sánchez and his radical left allies.

Her victory could have lasting ramifications for the way Spain is run in the years ahead. It could also have reverberations across Europe, providing a foretaste of the possible backlash from voters fed up with pandemic lockdown measures. It may even provide encouragement to other centre-right parties torn between traditional Christian Democratic moderation and the popular appeal of the polemical hard right.

The Madrid race was an ugly, demagogic campaign marked by personal insults, extreme statements and simplistic debates. It did not measure up to the social and political challenges that now test the region, the economic engine of Spain, as it emerges from the coronavirus crisis. Under Díaz Ayuso’s leadership, the regional government’s handling of the pandemic last year was too lax. Sánchez and Díaz Ayuso often seemed more concerned with scoring points against each other than managing infections together.

The central government was too dismissive of Madrid’s attempts to ease restrictions once infections receded. When the Socialists clumsily tried to bring down a centre-right-led regional government in Murcia, eastern Spain, earlier this year, Díaz Ayuso seized her own opportunity, calling early elections in the capital region. Voters warmed to her charisma and hard-right provocations that have brought comparisons with Donald Trump.

The main loser was the liberal Citizens party, which lost all its seats in the Madrid region. It now faces national collapse, depriving Spain of a moderating force in the political centre. In truth, the party never played the pivotal role billed for it. Pumped up by Spanish nationalism in the wake of Catalonia’s illegal secession referendum in 2017 and by hopes of displacing the corruption-tainted PP as the main opposition force, it veered to the right, destroying its raison d’être.

Three competing right-of-centre parties are now down to two. The PP has in effect reabsorbed the liberal centre. It did well enough in the right-leaning Madrid region, now to govern there without a formal alliance with the far-right Vox party. But it lacks a viable route to power nationally. If the PP panders to the far right in its own policies, it may lose swing voters. If it teams up with Vox post-election, it will struggle to obtain support from other regional smaller parties.

Prime Minister Sánchez meanwhile is weakened by his party’s poor showing. The socialists are tied to a badly wounded radical left, whose leader, Pablo Iglesias, quit as deputy premier to run against Díaz Ayuso, only to lose spectacularly. Sánchez’s fortunes may improve as the pandemic fades. He has EU money to spend. It will be hard to dislodge him before elections due in 2023. Increasingly, though, he appears to be in office but not in power.

It is difficult to see either of Spain’s left or rightwing blocs winning a convincing majority. Its regionalised state, meanwhile, looks increasingly disjointed. Díaz Ayuso’s success was built on defiance of central government authority. That is a worry when the pandemic is not over. Her libertarian pugnacity cut through to Madrid’s angry voters, all the more so as she was facing a leftwing bogey man. Spain needs a more intelligent political conversation than that.