(NYSE:GS), one of the largest investment banks in the United States, said on Friday that it will pay $3.15 billion to buy back low-quality mortgage bonds it had sold to Fannie Mae and Freddie Mac in the run-up to the 2008 financial crisis. Goldman Sachs Group Inc

The Federal Housing Finance Agency, or FHFA, which is the conservator for the two government-controlled mortgage finance companies, said in a statement released Friday that the Bank will pay approximately $2.15 billion to Freddie Mac and $1 billion to Fannie Mae.

The settlement, which is valued at $1.2 billion after deducting the current estimated value of the securities being bought back, “effectively makes Fannie Mae and Freddie Mac whole on their investments in the securities at issue,” FHFA said. “The settlement addresses claims alleging violations of federal and state securities laws in connection with private-label mortgage-backed securities (PLS) purchased by Fannie Mae and Freddie Mac between 2005 and 2007.”

This is the sixteenth settlement reached in the 18 lawsuits filed by the FHFA in 2011 against various financial institutions in an attempt to recover nearly $200 billion in low-quality mortgage bonds bought by Fannie Mae and Freddie Mac.

Gregory K. Palm, executive vice president and general counsel of Goldman Sachs, said that the bank is “pleased to have resolved these matters.”

Goldman Sachs had earlier argued that it had done its best to review the mortgages being sold to investors, according to a New York Times report. However, Fannie Mae and Freddie Mac accused the bank of deliberately offloading subprime mortgages and even placing bets against it without informing its clients.

Meanwhile, the U.S. Department of Justice, which on Thursday announced a $16.65 billion settlement with Bank of America Corp. (NYSE:BAC) over mortgage bonds, continues to investigate Goldman Sachs over its marketing of such securities.