The $968 million settlement, reached with the Justice Department and other government agencies, will include money for homeowner relief and a requirement that the company improve its handling of mortgage loans and foreclosures.

In announcing the agreement, authorities said SunTrust Mortgage, a Richmond, Virginia-based mortgage lender and subsidiary of SunTrust Banks Inc., originated and underwrote bad loans between 2006 and 2012, gave borrowers false and misleading information about the status of foreclosure proceedings and charged unauthorized fees.

The company's own internal documents showed an awareness of the problem, the government alleged, with one 2012 report referencing a "broken loan origination process."

"SunTrust's conduct is a prime example of the widespread underwriting failures that helped bring about the financial crisis" of 2008, Attorney General Eric Holder said in a statement. He said he expected similar cases in the future.

As part of the deal, SunTrust has agreed to pay $500 million to help borrowers at risk of default and homeowners who are underwater on their mortgages, and $418 million to resolve allegations that it underwrote bad loans. It's also agreed to a $50 million cash penalty, with $40 million to be distributed to borrowers and homeowners.

The settlement also involves the Department of Housing and Urban Development, the Consumer Financial Protection Bureau and state attorneys general from across the country. A monitor will ensure compliance with the agreement, which was filed in federal court in Washington.

SunTrust chief executive William H. Rogers Jr. said in a statement that SunTrust was pleased to have resolved the allegations. He said the company has made improvements to its mortgage underwriting processes and internal controls, including increased training.