Updated

The European Court of Justice ruled Thursday that harsh property repossession laws in Spain that have led to hundreds of thousands of evictions during the country's deep recession violate EU laws on consumer protection.

The watershed ruling said Spanish legislation infringes EU law as it does not allow courts to halt eviction orders on the basis of possible unfair terms in mortgage agreements.

The Luxembourg court ruling will almost certainly oblige Spain to amend its law and will also be taken into account by judges handling eviction cases.

More than 350,000 Spaniards have received eviction orders since 2008 because they were unable to make mortgage payments, though in most cases Spanish law required them to continue paying.

The national outcry recently prompted the ruling Popular Party to make a last-minute change of stance and agree to debate mortgage default law changes in Parliament.

Ada Colau, a spokeswoman for the Stop Evictions platform that has worked doggedly to halt evictions across the country, welcomed the ruling.

"We are very happy with the news because it's a clear show of support for what we have been demanding and denouncing for the past four years, that the procedure is illegal and violates fundamental rights," Colau told Cadena SER radio

She said the government "has no other option now" but to make amendments.

"People are losing their patience, lives are literally at stake, there is an entire generation traumatized by the devastating effects of these procedures," she said. "What more has to happen before the government responds?"

Justice Minister Alberto Ruiz Gallardon said Spain would respect the ruling.

Spain is in its second recession in just over three years and has 26 percent unemployment. Banks, meanwhile, have been blamed for a wave of mortgage foreclosures, homeowner evictions and at least five mortgage default-related suicides in recent months.

The collapse of the property market, which triggered the crisis in 2008, led to a fall in house prices but also saw a massive freeze in new purchasing and bank loans so that indebted house owners were unable to sell their properties and pay off their debt.

Thursday's ruling came after Barcelona Judge Jose Maria Fernandez Seijo sought the European tribunal's opinion on an eviction case taken by a bank against a Moroccan man who unable to pay off the balance of a €138,000 mortgage.

Fernandez Seijo said the ruling now gives "judges a much more powerful tool" with which they could at least suspend evictions.

The court decision, however, did not deal with one of the main demands by anti-eviction lobbyists, which is for an insolvency law that would allow those who have defaulted on their mortgages to simply turn in the keys to their homes as they do in countries like the United States, freeing them from mortgage debt.

Spain is one of the only countries in Europe which has such laws. Prime Minister Mariano Rajoy said Wednesday he is opposed to an all-encompassing insolvency law, saying it could throw the mortgage market into turmoil and eventually make it even more difficult for people to get loans for houses.