Two of the US's biggest mortgage lenders have had mortgage foreclosures cancelled in a case that could affect other banks.
The Supreme Court in Massachusetts ruled against US Bancorp and Wells Fargo in a widely watched case.
Backing a lower court ruling made in 2009, it said two foreclosure sales were invalid because the banks did not prove that they owned them at the time.
Bank shares fell sharply after the ruling dragging the wider market down.
The decision is among the earliest to address the validity of foreclosures done without proper documentation - so-called robo-loans because they were carried out by people who were unqualified and who often did not check a single line in the paperwork.
After the robo-loan scandal was exposed last year some lenders, including Bank of America, JP Morgan Chase and Ally Financial temporarily stopped seizing homes.
Analysts believe this latest court action will further affect the foreclosure process in the US.
Marty Mosby, an analyst at Guggenheim Securities said: "A ruling like this will slow down the foreclosure process. They're going to have to be really precise and get everything in order. It doesn't leave a lot of wiggle room."
The case also applies retrospectively to people who have already been foreclosed.
Glenn Russell, a lawyer for one of the couples in the case said: "I'm ecstatic. The fact the decision applies retroactively could mean thousands of homeowners can seek recovery for homes wrongfully foreclosed upon."
Wells Fargo and US Bancorp lacked the authority to foreclose after having "failed to make the required showing that they were the holders of the mortgages at the time of foreclosure," wrote Justice Ralph Gants for the Massachusetts court.
Justice Robert Cordy said the banks had displayed "utter carelessness" in documenting their right to own the properties.
Courts in other US states are considering similar cases, and all 50 state attorneys general are examining whether lenders are forcing people out of their homes improperly.
Michael Pill, a partner at Green, Miles, Lipton & Fitz-Gibbon, who represents homeowners and is not involved in the case, said: "What they were doing was peddling these mortgages and leaving the paperwork behind."
Wells Fargo had no immediate comment on the decision.
US Bancorp spokesman Steve Dale said the decision has no financial impact on the bank.
But leading bank shares were affected by the case.
Wells Fargo shares closed down 2.02%, US Bancorp shares were down 0.6, Bank of America was down 1.32% while JP Morgan fell 1.89%.
Analysts said the decision may also threaten banks' ability to package mortgages into securities, and may raise the spectre that loans transferred improperly will need to be bought back.