Deutsche Bank has cemented a $7.2 billion settlement with the Department of Justice for selling toxic mortgage-backed securities in the years before the market meltdown of 2008.

The DOJ said Tuesday that the settlement -- which includes a $3.1 billion civil penalty -- is the largest of its kind levied by the department.

The other $4.1 billion included in the settlement is earmarked for "relief to underwater homeowners, distressed borrowers and affected communities," DOJ said in a statement. That includes issuing loan forgiveness and forbearance and providing funding for affordable housing across the U.S., to be overseen by an independent monitor.

"Deutsche Bank did not merely mislead investors: It contributed directly to an international financial crisis," Attorney General Loretta Lynch said.

"Our conduct in this matter falls short of our standards and is unacceptable," said Deutsche Bank (DB) CEO John Cryan. "We apologize unreservedly for it. We have subsequently exited many of the underlying activities and comprehensively improved our standards."

The deal was first announced in December, but Tuesday marked the formal closure of the settlement.

The DOJ has spent the years since the 2008 financial crisis going after banks that were involved in dicey trading practices. Deutsche Bank (DB), like many of its competitors, was found to have packaged up poor-quality mortgage bonds into securities that looked like trustworthy investments.

The DOJ has levied more than $60 billion in fines over the toxic mortgages that plunged the world into a recession back in 2008. Among the other banks fined include JP Morgan (JPM), $13 billion; Bank of America (BAC), $16.7 billion; Goldman Sachs (GS), $5.1 billion; and Citigroup (C), $7 billion.