SunTrust Banks (STI) has agreed to pay almost $1 billion to settle a probe into its mortgage practices. While this may sound like a hefty penalty since the payment represents nearly 5% of SunTrust's market cap, the bank is more than likely very happy with the arrangement, and may even be looking forward to getting its next big payout over and done with.

Not only is the settlement significantly less than the bank thought it would be, but it puts the bank and its shareholders one step closer to putting the mortgage mess behind them.

And, since the government went after SunTrust's larger rivals first, recent settlements by JPMorgan Chase and the others give us a good indication of what's still coming.

Who gets the money?
Of the $968 million penalty, $418 million is a fine for non-compliance with the Federal Housing Administration's lending standards, which will be split among more than 50 state and federal agencies. Basically, in the pre-crisis years SunTrust was underwriting mortgages for FHA insurance that didn't meet the required standards.

In addition to the fine, SunTrust is paying $500 million in consumer relief to customers who are underwater on their mortgages, and another $40 million to customers who lost their homes during the foreclosure epidemic.

However, it's not all bad news for the bank. SunTrust had set aside $1.2 billion to settle the probe, so the bank over-prepared for this settlement. So, at some point we should see more than $200 million (or about $0.43 per share) make its way back onto SunTrust's balance sheet.

The big one is probably still to come
As is the case with larger rivals such as Bank of America and Citigroup, there is still one major settlement to go before the mortgage mess is firmly in the past.

SunTrust still faces an investigation by the U.S. Justice Department involving low-quality mortgages it sold to Fannie Mae and Freddie Mac. If the other banks are any indication, it could be the largest of the bank's mortgage-related settlements.

Rival JPMorgan Chase settled similar allegations for a record $13 billion, and the Justice Department is said to be seeking $17 billion and $10 billion from Bank of America and Citigroup, respectively. So, the Justice Department is likely to be the largest payout SunTrust faces.

Still, just like the other settlement, you can be fairly certain the bank is well aware of the potential payout and is over-preparing for it as well.

Aside from the Justice Department case, SunTrust also faces charges related to its participation in a Treasury Department mortgage-modification program. While the bank has warned of "substantial penalties", it will likely be much less costly than the other cases.

"Sunny" days at SunTrust
Aside from the ongoing legal issues, SunTrust's business is doing quite well.

According to the SunTrust's recent presentation at its annual meeting, the bank's tangible efficiency ratio has improved by about 5% since 2010, and is projected to continue improving this year.

Not only has the company's loan portfolio grown by 5%, but net charge-offs plunged by 60% year-over-year and now represent just 0.55% of the total, down from 1.37% in 2012. Also, the amount of nonperforming loans dropped by 37%, and is down to just 0.76% of the company's loans from 1.27% last year.

The bottom line
Don't get too caught up in all of the legal drama. Just like the bigger banks, SunTrust is well aware of what is still to come and will more than prepare for it.

The lingering effects of the mortgage crisis have taken longer than anyone would have liked to finally be over and done with. However, someday it will be, and I believe investors will be glad they stuck around, especially with solid institutions like SunTrust.