The Justice Department completed a deal with Deutsche Bank on Tuesday that will require the bank to pay $7.2 billion for its sale of toxic mortgage securities in the run-up to the 2008 financial crisis, the department said.

The settlement calls on Deutsche Bank to pay a civil penalty of $3.1 billion and provide $4.1 billion in consumer relief to homeowners, borrowers and communities harmed by its practices.

The total is the largest amount ever paid to resolve charges against a single entity for misleading investors in residential mortgage-backed securities, the department said in a statement.

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