Bank of America has reached a record $17 billion settlement to resolve an investigation into its role in the sale of mortgage-backed securities before the 2008 financial crisis, officials directly familiar with the matter said Wednesday.

One of the officials, who spoke with The Associated Press on condition of anonymity because the announcement isn't scheduled until Thursday at the earliest, said the bank will pay $10 billion in cash and provide consumer relief valued at $7 billion.

The deal is the largest settlement arising from the economic meltdown in which millions of Americans lost their homes to foreclosure. It follows agreements in the last year with Citigroup for $7 billion and with JPMorgan Chase & Co. for $13 billion.

Like the Bank of America deal, those settlements were a mixture of hard cash and "credits" for various forms of consumer aid that the banks promised to provide in coming years.

The Bank of America settlement was negotiated through a joint federal and state working group established by President Barack Obama two years ago with the Justice Department and other federal and state authorities. Individual states are expected to share in the settlement.

Justice Department spokeswoman Ellen Canale declined to comment, as did New York Attorney General Eric Schneiderman, a co-chairman of the group. The bank also declined comment.

The deal requires Bank of America to acknowledge making serious misrepresentations about the quality of its residential mortgage-backed securities issued by itself and by Countrywide Financial and Merrill Lynch. Those institutions were acquired by the bank when they were on the brink of failure in 2008 and they were responsible for the bulk of the questionable loans.

The deals are intended to offer some financial relief to homeowners, whose mortgages were bundled into securities by the banks in question and then sold to investors.

The securities contained residential mortgages from borrowers who were unlikely to be able to repay their loans. Still, the securities were promoted as relatively safe investments until the housing market collapsed and investors suffered billions of dollars in losses.

The poor quality of the loans led to huge losses for investors and a slew of foreclosures, kicking off the recession that began in late 2007. The cash totals now being paid by some of the country's largest banks are not nearly enough to reverse the damages caused by the bursting of the housing bubble and the ensuing recession.

Bank of America had argued that it shouldn't be held liable for the subprime mortgages issued by Countrywide and Merrill Lynch. Combined, those three firms issued $965 billion in mortgage-backed securities from 2004 to 2008, according to public records. Roughly 75 percent of that total came from Countrywide.

In a federal lawsuit last year, the Securities and Exchange Commission charged Bank of America and two subsidiaries with defrauding investors in an offering of residential mortgage-backed securities by failing to disclose key risks and misrepresenting facts about the underlying mortgages.

The Justice Department filed a parallel civil action against Bank of America alleging violations of the Financial Institutions Reform, Recovery, and Enforcement Act.