The European Court of Justice has ruled 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.

Activists said the decision could lead judges to halt thousands of bank repossession proceedings.

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.

Over 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.

At least five people have committed suicide in Spain since last autumn because they had been evicted or were about to be forced from their repossessed homes.

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. Justice Minister Alberto Ruiz Gallardon said Spain would respect the ruling but provided no details how the government will respond.

Spain is in its second recession in just over three years and has an unemployment rate of 26%. Banks, meanwhile, have been blamed for the wave of repossessions and homeowner evictions, as well as the suicides.

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.

This week'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 was unable to pay off the balance of a €138,000 mortgage.

His contract allowed the bank to tack on an annual interest rate of 18.75% for unpaid amounts without notice, and to demand payment of the full balance of the mortgage after just one payment had been missed.

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 US, freeing them from mortgage debt.

Prime Minister Mariano Rajoy said earlier this week that 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.

After the first eviction suicides last year, Rajoy's government in November approved a two-year suspension of evictions for some needy homeowners unable to pay their mortgages. But activists said the measure did not go far enough and failed to address the larger issue of how many who give up their homes remain indebted. Children in Spain inherit unpaid mortgage debt if their parents die before paying it off.