The government said the $1.7 billion represented the largest ever bank forfeiture and the largest Department of Justice penalty for a Bank Secrecy Act violation. The settlement includes a so-called deferred prosecution agreement that requires the bank to acknowledge failures in its protections against money laundering but also allows it to avoid criminal charges. No individual executives were accused of wrongdoing.

The deal was announced by the office of U.S. Attorney Preet Bharara, who scheduled an afternoon news conference to detail the agreement to resolve criminal charges: two felony violations of the Bank Secrecy Act in connection with the bank's relationship with Bernard L. Madoff Investment Securities, the private investment arm of Madoff's former business.

Under the agreement, the criminal charges will be deferred for two years as JPMorgan admits to its conduct, pays the $1.7 billion to victims of Madoff's fraud and reforms its anti-money laundering policies, prosecutors said in a release.

The deal was similar to one reached in late 2012 with the British bank HSBC, which agreed to pay $1.9 billion to settle claims it laundered money for Iran, Libya and Mexico's murderous drug cartels. Some observers called the HSBC settlement -- which included a $1.25 billion forfeiture and $655 million in civil penalties -- an example of the government stopping short of bringing criminal charges against a big bank or its executives because such prosecutions could be devastating enough to cause the institution to fail.

JPMorgan was Madoff's primary bank in the later years of a multi-decade fraud that ended in 2008 when he revealed to the FBI that his investment advisory business was a Ponzi scheme.

Account statements for thousands of clients showing $60 billion in assets were fiction. Of the roughly $17.5 billion in principal that was real, most of it was gone.

Since then, a court-appointed trustee has recovered more than $9.5 billion to redistribute to burned clients. The trustee sued JPMorgan for $6.4 billion in 2010, accusing the bank of being "willfully blind" and "thoroughly complicit" in the fraud, but an appeals court found in 2012 that he had no legal standing to make the claim.

The JPMorgan settlement is the latest in a series of major deals it has made to resolve its legal troubles. In November, the bank agreed to pay $13 billion over risky mortgage securities it sold before the financial crisis -- the largest settlement to date between the Justice Department and a corporation.

JPMorgan still has several lawsuits pending against it related to the high-risk mortgage bonds that soured after the housing market collapsed in 2007. There's also an ongoing criminal investigation led by the office of U.S. Attorney Benjamin Wagner in Sacramento, Calif.

The bank may be negotiating or litigating over the issue for years and has set aside $23 billion to cover those costs. JPMorgan told regulators in a filing in October that it may need as much as $5.7 billion more.