By David Sherwood

AUGUSTA, Maine (Reuters) - Homeowners in Maine gained stronger protection against bank foreclosures under legislation approved late on Tuesday over the objections of some of the United States' largest lenders in what consumer advocates called a win for homeowners.

The new law makes Maine one of few U.S. states to legislate over accusations nationwide that banks used suspect mortgage documentation in home foreclosures after the 2008 credit crisis.

The focus of the dispute is Mortgage Electronic Registration Systems (MERS), set up by U.S. banks before the housing bubble of the 2000s. MERS was meant to streamline the packaging of loans into mortgage-backed bonds. After the bubble burst, MERS was besieged by litigation.

MERS lists itself as holder of millions of U.S. mortgages, allowing lenders to bypass public records when mortgage loans are bought and sold. During the housing crisis, critics said, MERS helped lenders push out poorly documented mortgages, confused homeowners about the true owner of their loans, and contributed to wrongful foreclosures.

Republican Governor Paul LePage vetoed the Maine legislation, but the state legislature overrode the veto Tuesday night. The law effectively affirms a 2014 Maine Supreme Court ruling that challenged a MERS-related foreclosure, though limiting its impact to future cases.

"This isn't just technical nonsense. This is a really powerful step in restoring the integrity of the real estate title system," said Thomas Cox, a Maine attorney who argued the case before Maine's highest court.

The Maine Supreme Court case was Bank of America Corp vs. Greenleaf, in which the court held that the bank could not rely on MERS to prove its right to foreclose.

Legal experts said the decision meant banks would have to show ownership of a mortgage by seeking out the loan's original lender or offering other proof, a hurdle the mortgage industry argued was unnecessarily onerous.

The new law validates past transactions that relied on MERS, including foreclosures, and assures homeowners clear title, but requires future foreclosures to meet the requirements of the Greenleaf decision.

"We are pleased that the Maine legislature took steps to make clear that homebuyers no longer have to be concerned about potential issues arising from uncertainty about MERS' authority," said MERS spokeswoman Janis Smith.

Foreclosures in Maine plunged sharply after the Greenleaf decision, court records showed.

National banks, title companies and realtors argued the Greenleaf decision threw business into disarray and raised questions about thousands of Maine mortgages registered with MERS, creating potential title defects.

(Reporting by David Sherwood in Augusta, Maine; Additional reporting by Dena Aubin in New York; Editing by Kevin Drawbaugh and Lisa Shumaker)