Four million Spanish workers took part in a general strike on Wednesday, unions said, enduring stormy weather to set up picket lines in a protest against the country's housing affordability crisis less than three weeks before a snap general election. It was Spain's first general strike since workers downed tools in 2012 against austerity measures during the euro zone debt crisis.

The 24-hour walkout, called by Spain's two biggest unions, the UGT and the CCOO, under the slogan "Salaries. Housing. Prices.", was backed by tenants' associations angry about rising rents and evictions. Unions described the strike as a success, with participation reaching 90 percent at ports and in the automotive sector and "total stoppages" reported at factories including Volkswagen's in Navarre and SEAT's in Barcelona.

On Madrid's Gran Via, one of the capital's main shopping streets, protesters cheered as stores including Primark, H&M and Pull & Bear drew their shutters amid a heavy riot police presence. Many shops in Barcelona were also closed and boarded up in anticipation of unrest. Electricity demand dropped by as much as 15.5 percent between 10 a.m. and 11 a.m., according to grid operator Red Electrica, and Madrid metro peak-hour usage was down 42 percent on the same period last week. More than 280 flights were cancelled during the day.

By the evening, clashes had erupted in parts of Barcelona and Madrid. Police reported at least 73 arrests nationwide by 9 p.m. from at least 1,044 incidents linked to the strike, including blockades of offices and industrial estates and burning of rubbish containers. Unions said they would file a criminal complaint over what they described as a "disproportionate" police response involving tear gas and batons that left 20 protesters injured.

Spain has a deficit of about 750,000 homes, which is set to grow to more than a million by 2028, according to the central bank. The average rental price of 1,176 euros ($1,315) a month is equivalent to about 98.7 percent of a young person's average monthly salary in Spain, according to the Youth Council of Spain. Rents have nearly doubled over the past decade.

The strike follows weeks of demonstrations provoked by the eviction and subsequent death of Maricarmen Abascal, an 87-year-old woman in Madrid. Prime Minister Pedro Sanchez, who backs the strike and hopes to harness voter resentment over housing in the November 29 election, is putting two housing decrees to a vote on Thursday. His Socialist Party still trails in opinion polls, and business lobby CEOE called the strike counterproductive. BBVA Research estimated the stoppage could shave 0.1 to 0.2 percent off Spain's annual gross domestic product.