SunTrust is the latest bank to settle with a consortium of state and federal officials over mortgage servicing mistakes, under a deal Tuesday that’s close to $1 billion.

North Carolina homeowners with SunTrust mortgages are due to receive $21.5 million in payments and loan modification relief, Attorney General Roy Cooper’s office said.

An additional $2 million will to go about 2,500 people who lost their homes to foreclosure. That comes out to about $800 per borrower.

Regulators allege that SunTrust took shortcuts in mortgage servicing, including mass production of foreclosure documents known as robo-signing.

“People who take out a mortgage expect and deserve fair treatment,” Cooper said in a statement. “Thanks to this agreement, deserving homeowners will get direct relief and future borrowers will get better protections.”

Atlanta-based SunTrust will pay $550 million to states and the U.S. Housing and Urban Development as part of a settlement that’s related to a $25 billion accord reached with Bank of America, Wells Fargo and three other big banks back in 2012.

SunTrust is paying the U.S. Department of Justice $418 million in a separate but related settlement. The Justice Department said that SunTrust admitted to improperly originating government-backed loans and that internal audits had revealed problems in mortgage underwriting.

“As we said when these agreements in principle were announced, we are pleased to have resolved these legacy mortgage matters,” SunTrust CEO William H. Rogers Jr. said in a statement. “Like most major financial institutions, we are addressing issues related to mortgage matters stemming from the financial crisis and recession period.”

SunTrust has the fifth-largest deposit market share in the Charlotte area, with about $1.4 billion in deposits across 37 branches.