Open this photo in gallery:

Spain’s Prime Minister and Secretary-General of the Spanish Socialist Party (PSOE) Pedro Sánchez speaks during a pre-election campaign event in Seville on Thursday.JORGE GUERRERO/AFP/Getty Images

Europe’s last standing progressive warrior may be on his last legs.

Spanish Prime Minster Pedro Sánchez called a snap election for Nov. 29, hoping to capitalize on public outrage over the eviction of an 87-year-old woman from her Madrid apartment and the refusal of right-wing parties in Congress to back tougher tenant-protection laws.

Instead, the election has become a referendum on Mr. Sánchez’s eight-year experiment in ultra-progressive governance that has left Spaniards deeply divided over his pro-immigration, pro-Palestinian and anti-defence-spending policies, and struggling to keep up amid soaring rents and stagnant wages caused by an influx of newcomers.

In calling the election, Mr. Sánchez boasted that his government had made Spain a “global reference point for peace, feminism and prosperity,” stood up to “tyrants, tech oligarchs and speculators” and produced the “best economic, social and environmental results” since the country’s return to democracy in 1977.

Workers across Spain stage first general strike in 14 years over housing crisis

Mr. Sánchez’s unapologetically woke playbook kept him in power until now, thanks to support in parliament from far-left parties and Catalonian and Basque nationalists. But that strategy has unravelled in recent months amid the implosion of his far-left coalition partners and a withdrawal of support from some independentistas.

No policy symbolizes Mr. Sánchez’s particular brand of politics – known in Spain as Sanchismo – more than his government’s plan to grant amnesty to hundreds of thousands of undocumented immigrants. The government estimated that about 500,000 mostly Latin American migrants living illegally in Spain could gain legal status under the plan. But the government has received almost 1.2 million applications for amnesty, underscoring the size of Spain’s underground economy.

The amnesty plan has polarized public opinion. The far-right Vox party led by Santiago Abascal, who warns of a “migrant invasion” of Spain, has arguably been the biggest winner from it. Vox has seen its support soar in recent months, with polls showing almost one in five voters now backing the party.

Open this photo in gallery:

Santiago Abascal, leader of far-right party Vox, waves as he leaves after a pre-election campaign event in Logrono, Spain, on Thursday.CESAR MANSO/AFP/Getty Images

Vox’s rise plays into Mr. Sánchez’s strategy by helping mobilize the base of his Socialist Workers’ Party and stoke fears that a government led by the centre-right People’s Party would be beholden to Mr. Abascal, who opposes progressive laws passed under Mr. Sánchez, including ones aimed at reducing gender-based violence, expanding transgender rights and pardoning Catalonian separatists who organized an illegal referendum in 2017.

Mr. Abascal and People’s Party Leader Alberto Núñez Feijóo both blame the country’s housing crisis on Mr. Sánchez’s open immigration policies and government regulations that have led to fewer new homes being built in Spain than in other European countries.

Though Mr. Sánchez voiced support for workers who participated in a general strike this week – Spain’s first in 14 years – the massive demonstrations nevertheless underscored the depth of discontent in the country.

Dozens of protesters gathered outside Madrid municipal bus depot on Wednesday, attempting to prevent buses from leaving as part of Spain’s first general strike in 14 years. Reuters

Under Mr. Sánchez, Spain has doubled down on tourism and immigration to boost economic growth. But the policy has led to the conversion of thousands of apartments into short-term rentals, angering local residents, and skewed employment toward lower-wage hospitality jobs, often filled by foreign workers. At more than 10 per cent, Spain’s unemployment rate is the second-highest in Europe.

If that was not enough, the campaign has not gone Mr. Sánchez’s way.

A devastating Oct. 28 high-speed train accident that left 69 people dead has focused attention on the deterioration of Spain’s vast rail network in recent years. Spain invested massively in high-speed rail thanks to the generous European Union subsidies it got after joining the EU in 1986. But maintaining the system has proved costly. Critics have accused Mr. Sánchez’s government of prioritizing social programs over infrastructure.

The accident led to the resignation of his transport minister, Óscar Puente. He was the second Sánchez transport minister to leave under a cloud after Mr. Puente’s predecessor, José Luis Ábalos, was convicted in June on corruption charges and sentenced to 24 years in prison.

Faces from the front lines of Spain’s housing crisis

Vox has also seized on a surge this month in migrants arriving by boat in the Canary Islands from West Africa, with more than 6,000 landing there since the beginning of November, to blame the Sánchez government for encouraging migrants and smugglers with its lax approach to migration. The North African Spanish possession of Ceuta saw more than 80,000 Moroccan migrants flood the territory this summer, and while most have returned home, more than 10,000 migrants remain in the city, putting a strain on public services.

Polls show Mr. Feijóo’s party in the lead, though it is not likely to win enough seats in Congress to govern on its own. The election result could turn on whether Mr. Sánchez can persuade enough voters of the danger of a potential People’s Party-Vox coalition taking power.

It has worked for him before. But this time seems different.