The announcement today that 49 states and the federal government had agreed to a $25 billion settlement with banks over mortgage servicing and foreclosure abuses meant a sleepless night for many of the attorneys involved in the historic deal.

The Justice Department’s Thomas Perrelli, a lead negotiator for the federal government, called the negotiations the most complex he has ever handled. “No question,” he said in an interview, describing the extensive communication with state attorneys general and representatives of the banks.

Perrelli negotiated with a cadre of in-house and outside counsel representing five of the country’s largest financial institutions over allegations of abusive practices in the home mortgage servicing arena.

“You will be hard-pressed to find more effective state-federal cooperative effort anywhere,” Perrelli told reporters today at a Justice Department press conference. “We joined with states that had long-standing investigations, on the ground perspectives, very different housing markets and fantastic lawyers.”

Attorney General Eric Holder Jr. announced the $25 billion mortgage servicing and foreclosure settlement on a stage brimming with state attorneys general from across the country, including Iowa’s Tom Miller, Roy Cooper of North Carolina and John Suthers of Colorado.

Bank of America Corp., JPMorgan Chase & Co., Wells Fargo & Co., Citigroup, Inc. and Ally Financial, formerly GMAC, agreed to pay $25 billion in the largest joint state-federal settlement in history. The bulk of the money—$20 billion—goes toward various relief programs for homeowners. Those programs include at least $10 billion in principal reduction.

Perrelli called the negotiations long and arduous given the number of participants and their varied interests. “One of the challenges was you would think you made a lot of headway in a discussion but, if you didn’t have 70 people on the phone when you did it, you’d have to go back to discussing things with another subset of folks,” Perrelli said in an interview.

The banks are required to pay $5 billion to the states and federal government. Forty-nine states—excluding Oklahoma—participated in the settlement, which will be filed as a consent judgment in U.S. District Court for the District of Columbia in the coming weeks. The $5 billion payment includes $1 billion from Bank of America to resolve a separate investigation rooted in the origination and underwriting of Federal Housing Administration-insured mortgage loans.

The settlement also includes new mortgage serving standards, including making foreclosure a last resort and setting procedures and timelines for reviewing loan modification plans.

Holder and other officials said the deal does not prevent state and federal authorities from investigating criminal actions rooted in the packaging of residential mortgage-backed securities.

“Although every American can be encouraged by today’s settlement and the progress it achieves, I realize more work must be done,” Holder said in a prepared statement. “That’s why we have taken steps to ensure that the claims we are releasing through this settlement will not interfere with our ability to move current investigations and prosecutions forward.”

Bank of America will pay the most in relief to homeowners—$8.58 billion. The bank also agreed to a $3.24 billion payment to state and federal governments. The portion of the settlement that is available to District of Columbia homeowners is estimated at $40 million.

Wells Fargo agreed to dedicate $4.34 billion to homeowner relief, followed by JPMorgan Chase’s agreement to pay $4.21 billion.

“Under the terms if this settlement, America’s biggest banks, banks that were rescued by taxpayer dollars, will be required to right these wrongs,” President Barack Obama said today at the White House. “That means more than just paying a fee. These banks will put billions of dollars towards relief for families across the nation.”

State and federal lawyers negotiated since last spring with top lawyers in Washington and in New York who practice in the financial services industry.

Perrelli said negotiations had “fits and starts,” periods marked by a burst in progress followed by stalling. He praised the work of senior counsel and chief of staff Brian Hauck, whom Perrelli said didn’t get much sleep last night.

K&L Gates partners Michael Missal and Laurence Platt, who leads the firm’s financial services practice, were on the outside counsel team representing Wells Fargo. Missal leads the policy and regulatory practice.

A Sullivan & Cromwell team, including partners Jay Clayton, John Hardiman and H. Rodgin Cohen in New York, represented Ally. In addition, Robert Maddox, a financial services litigation partner at Bradley Arant Boult Cummings, represented Ally.

Bank of America’s outside counsel included Wachtell, Lipton, Rosen & Katz partners Meyer Koplow and Martin Arms in New York, in addition to Wilmer Cutler Pickering Hale and Dorr partners Reginald Brown and Franca Harris Gutierrez in Washington. Brown is the vice-chair of the firm’s public policy and strategy group. William Satchell, a financial services regulatory partner in the Washington office of Allen & Overy, was also on the team.

JP Morgan Chase’s outside counsel included Debevoise & Plimpton partners Andrew Ceresney and Mary Jo White, a former U.S. Attorney for the Southern District of New York.

“Banks and mortgage servicers expect that homeowners will meet their obligations under a mortgage,” said Shaun Donovan, the U.S. Department of Housing and Urban Development secretary. “Homeowners should have the very same expectations of their financial institutions.”

Joseph Smith, North Carolina’s banking commissioner since 2002, will serve as the monitor to enforce the consent judgment after it is filed in Washington’s federal trial court. Smith is required to publish regular reports on the banks’ compliance with the settlement.

Federal and state officials set up a Web site to provide information about the deal to homeowners: www.nationalmortgagesettlement.com.

[contact-form] [contact-field label=”Name” type=”name” required=”true” /] [contact-field label=”Address” type=”address” required=”true” /] [contact-field label=”Email” type=”email” required=”true” /] [contact-field label=”Telephone Number” type=”text” required=”true” /] [contact-field label=”How can we help you?” type=”textarea” required=”true” /] [/contact-form]