Bank of America announced last week that it has reached a settlement with the U.S. Department of Justice and state attorneys general to resolve allegations that the bank sold faulty mortgage securities.

The $16.7 billion settlement is, according to the Justice Department, the largest civil settlement in American history involving a single entity.

BofA has agreed to pay a $5 billion penalty—the largest ever levied—and to provide $7 billion in relief to borrowers affected by the bank’s alleged conduct.

The settlement—involving the SEC, Federal Housing Administration, FDIC and the Government National Mortgage Association, along with attorneys general from six states—relates to allegations that the bank and its former and current subsidiaries, including Countrywide Financial Corp. and Merrill Lynch, sold flawed securities in the lead-up to the 2008 financial crisis.

Borrower relief will be provided in the form of loan modifications, low- to moderate-income mortgage originations and community reinvestment and stabilization efforts. Relief will be provided no later than Aug. 31, according to the bank.

The Justice Department said an independent monitor will be appointed to determine whether the bank is fulfilling its obligations. BofA will be required to pay liquidated damages to community development organizations if it fails to satisfy the requirements of the settlement by the established date.