WASHINGTON — President Barack Obama and top US mortgage lenders unveiled a landmark $25 billion deal Thursday to help struggling homeowners get back on their feet and to untether the moribund housing market.

Five of the country's top banks, the federal government and 49 states -- all except Oklahoma -- agreed to help homeowners cut their mortgage debt, avoid default or get compensation for unfair home repossessions.

President Barack Obama said the pact would "turn the page on an era of recklessness that has left so much damage in its wake."

The agreement provides a glimmer of hope for four million families who lost their homes during the financial crisis and the millions more who watched the market value of their homes slump while the cost of their mortgages remained at boom-era prices.

It also offers an estimated $2000 in compensation for everyone who lost their homes amid questions about banks losing paperwork and signing documents without due process -- so-called robosigning.

The housing bubble was at the center of the 2008 financial crash, the worst in 80 years.

In the boom years, Americans borrowed beyond their means as Wall Street overdosed on exotic mortgage-based derivatives, further inflating the market.

While the three-year deal will not come close to cleaning up all the damage caused by the crisis, there is expectation it will be a boon for the market and the broader economy.

But details -- particularly how much is used to write-off mortgage principal -- will determine how much of a boon, according to Ted Gayer, co-director of economic studies at The Brookings Institution.

"A lot of the other stuff has already been done with marginal effects," he said.

"Lets say we get $10-20 billion of principal reduction... $10-20 billion dollars doesn't seem huge when you are talking about $700 billion in underwater equity, so I would not expect huge effects."

"The only caveat is there could be an effect from some sort of resolution of uncertainty for the banks."

For Bank of America, JPMorgan Chase, Wells Fargo, Citibank and Ally Financial, the deal begins to close the curtain on a fraught period marked by multiple law suits and government probes.

Supporters hope the deal will make banks more willing to resume lending and, if successful, will show banks the benefits of future voluntary writedowns.

"A final agreement can play an important role stabilizing and providing certainty and confidence to the housing and mortgage markets," said David Stevens, head of the Mortgage Bankers Association.

But US Attorney General Eric Holder was quick to stress the deal does not give criminal immunity to lenders, or to traders who improperly sold mortgage-backed securities.

"It does not prevent state and federal authorities from pursuing criminal enforcement actions," he said, adding that a new taskforce was looking into how Wall Street securitized mortgages.

The deal will see at least $17 billion spent on principal reduction for borrowers who are delinquent or at imminent risk of default, $3 billion for borrowers who are underwater, and $1.5 billion for those whose homes were foreclosed from 2008 to 2011.

Around $4.3 billion will be distributed to states.

The deal does not include mortgages held by Fannie Mae and Freddie Mac, which make up the bulk of home loans in the United States.

California Attorney General Kamala Harris said she for one would try to forge a deal with the two government-backed lenders.

"I will continue to fight for principal reductions for the approximately 60 percent of California homeowners whose loans are owned by Fannie Mae and Freddie Mac," she said.

Oklahoma was the sole holdout on Thursday's deal, no immediate explanation was available from the office of the state's Attorney General.

Bank shares were largely unaffected by the news.