This Tuesday, Jan. 14, 2014 file photo shows a Bank of America sign in Philadelphia. Officials familiar with the deal say Bank of America on Wednesday, Aug. 20, 2014 has reached a record $17 billion settlement with federal and state authorities over its role in the sale of mortgage-backed securities in the run-up to the 2008 financial crisis. (AP Photo/Matt Rourke, File)

WASHINGTON (AP) — The government has reached a $16.65 billion settlement with Bank of America over its role in the sale of mortgage-backed securities in the run-up to the financial crisis, the Justice Department announced Thursday.

The deal calls for the bank, the second-largest in the U.S., to pay a $5 billion cash penalty, another $4.6 billion in remediation payments and provide about $7 billion in relief to struggling homeowners.

The settlement is by far the largest deal the Justice Department has reached with a bank over the 2008 mortgage meltdown. In the last year, JPMorgan Chase & Co. agreed to a $13 billion settlement while Citigroup reached a separate $7 billion deal.

At a news conference, Attorney General Eric Holder said the bank and its Countrywide and Merrill Lynch subsidiaries had "engaged in pervasive schemes to defraud financial institutions and other investors" by misrepresenting the soundness of mortgage-backed securities. The penalties, Holder said, go "far beyond the cost of doing business."

According to one example laid out by the government, Bank of America knew that a significant number of loans packaged into $850 million in securities were experiencing a marked increase in underwriting defects. Notwithstanding the red flags, the bank sold these residential mortgage-backed securities to federally backed financial institutions, the government said in a 30-page statement of facts that is part of the settlement.

In California, Countrywide concealed from investors the company's use of "shadow guidelines" that permitted loans to riskier borrowers than Countrywide's underwriting guidelines would otherwise allow, according to the statement of facts.

In addition, over a period of years, "Countrywide and Bank of America unloaded toxic mortgage loans on the government sponsored enterprises Fannie Mae and Freddie Mac with false representations that the loans were quality investments," said Preet Bharara, the U.S. attorney for the southern district of New York.

The government said the civil settlement, the largest reached with a single entity, does not release individuals from civil charges, nor does it absolve Bank of America, its current or former subsidiaries and affiliates or any individuals from potential criminal prosecution.

Bank of America CEO Brian Moynihan said in a statement that the company believes the settlement "is in the best interests of our shareholders and allows us to continue to focus on the future."

The bank said in a filing Thursday that the deal will likely reduce its third-quarter pretax earnings by $5.3 billion, or about 43 cents a share after taxes. Bank of America, based in Charlotte, North Carolina, had already had its second-quarter earnings hit by litigation costs related to mortgage securities cases. Its net income of $2 billion in April-June was down 43 percent from $3.6 billion a year earlier.

Of the $16.65 billion the bank is paying in the settlement, almost $10 billion will be paid to settle federal and state civil claims by entities related to residential mortgage-backed securities, collateralized debt obligations and other types of fraud.

An independent monitor will determine whether Bank of America is satisfying its obligations under the settlement.

"In the run-up to the financial crisis, Merrill Lynch bought more and more mortgage loans, packaged them together and sold them off in securities — even when the bank knew a substantial number of those loans were defective," said U.S. Attorney Paul Fishman, whose jurisdiction covers New Jersey.

The Bank of America settlement will resolve allegations that the bank and companies it later bought misrepresented the quality of loans they sold to investors. Most of the problem loans were sold by Countrywide Financial and Merrill Lynch before Bank of America bought them during the 2008 financial crisis.

Consumer advocates say previous settlements show that the amounts announced in enforcement actions can overstate their actual costs to the companies being penalized.

In the deal with JPMorgan in November, the Justice Department had a clear message for homeowners: Billions of dollars' worth of help was coming. Holder at the time described the appointment of an independent monitor who would distribute $4 billion set aside for homeowner relief.

The actual relief is more complicated than cash handouts, however.

Both Citigroup and JPMorgan earn credits under the settlement from a "menu" of different consumer-friendly activities, according to settlement documents. The options are effectively an update of the consumer relief previously provided through the national mortgage servicing settlement, a 2012 deal between state attorneys general and the major banks.

JPMorgan probably will earn its $4 billion in credits under the settlement through a total of $4.65 billion of activities that qualified as relief, according to a report by Enterprise Community Partners, a nonprofit run by executives from low-income housing groups and major banks.

More than half will come from principal reductions, with the rest earned through actions such as writing new loans in distressed areas, donating foreclosed properties to community groups and temporarily suspending payments on some loans.

___

Associated Press writer Jeff Horwitz contributed to this report.

Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

*We welcome your comments on the stories and issues of the day and seek to provide a forum for the community to voice opinions. All comments are subject to moderator approval before being made visible on the website but are not edited. The use of profanity, obscene and vulgar language, hate speech, and racial slurs is strictly prohibited. Advertisements, promotions, spam, and links to outside websites will also be rejected. Please read our terms of service for full guides