Millions of Spanish workers walked off the job on Wednesday in the country's first general strike in 14 years, braving stormy weather to set up picket lines in a mass protest against soaring rents and a housing affordability crisis.

Unions said four million people had joined the 24-hour stoppage by midday, with the tenants' union expecting participation to reach five million by the end of the day. Spain has around 23 million workers. The strike was the first since November 2012, when workers downed tools against austerity measures during the eurozone debt crisis — and the first whose driving force was housing.

'Salaries. Housing. Prices.'

The walkout, held under the slogan "Salaries. Housing. Prices.", was backed by Spain's two largest unions, the CCOO and the UGT, representing more than a million workers, as well as tenants' associations angry about rising rents and evictions. Businesses and public transport were shut down across the country, and the strike culminated in marches of tens of thousands of people in downtown Madrid and Barcelona.

Participation was highest in energy-intensive industry, car manufacturing, petrochemicals, meat processing, logistics, waste collection and transport, the unions said, with reported stoppage rates ranging from 41 per cent in Castilla-La Mancha and Extremadura to more than 80 per cent in Catalonia and Andalusia. Police used pepper spray against protesters in Madrid, and the capital's High Court suspended minimum service levels decreed by the regional government for education, justice and transport.

A housing deficit of 750,000 homes

At the heart of the protest is a housing market that has priced out millions of working people. Spain has a deficit of about 750,000 homes, which the central bank says is set to grow to more than a million by 2028. Rents have climbed sharply while wages have lagged, and evictions have become a flashpoint.

The housing movement gathered force at the end of September after the eviction of Maricarmen Abascal, an 87-year-old woman who had rented for decades in Madrid's Retiro neighbourhood. Activists are demanding the elimination of tourist apartments, a crackdown on real-estate speculation and automatic lease renewals for renters.

An election in 18 days

The strike comes less than three weeks before a snap general election on November 29. Prime Minister Pedro Sánchez hopes to harness voter resentment over housing to shift the political narrative away from corruption cases involving his inner circle and a deadly train crash last month. The opposition Popular Party dismissed the stoppage as an "electoral strike" rather than a genuine general strike.

Whatever the election outcome, the turnout sent a message that housing — once a local grievance — has become a national political issue, and one that neither side in the campaign can now afford to ignore.