SunTrust, Wells Fargo and Citigroup agreed to pay Freddie Mac a total of $1.3 billion related to bad mortgage loans they sold to the government-backed firm.

Atlanta-based SunTrust agreed to pay $65 million, $25 million of which it had previously paid. The fines are related to 312,000 loans SunTrust made between 2000 and 2008.

The move “marks another step in our resolution of legacy mortgage-related matters,” SunTrust Mortgage CEO Jerome Lienhard said in a statement.

Wells Fargo agreed to pay $869 million for about 6.7 million loans sold to Freddie Mac between 2000 and 2008 and Citigroup agreed to pay $395 million for 3.7 million loans sold between 2000 and 2012.

Each bank has been released from future repurchase obligations for those loans.

“With these settlements, Freddie Mac is recouping funds effectively due to the nation’s taxpayers,” Freddie Mac CEO Donald H. Layton said in a statement.