SunTrust has reached a nearly $1 billion settlement with the government to resolve allegations that it underwrote and provided risky mortgage loans.

The Justice Department on Tuesday announced the $968 million deal with SunTrust Mortgage, a Virginia-based lender and subsidiary of SunTrust Banks.

Attorney General Eric Holder said SunTrust's conduct is a "prime example" of the widespread underwriting failures that helped bring about the recent financial crisis.

As part of the deal, SunTrust has agreed to provide $500 million in homeowner relief and $418 million to resolve allegations that it underwrote bad loans.

SunTrust chief executive William Rogers said in a statement that the bank was pleased to have resolved the allegations.

Associated Press has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.