It was a $2.6 billion day of reckoning for JPMorgan Chase over its decades of dealings with Bernard Madoff.
Federal prosecutors announced a $1.7 billion settlement with the bank, which was accused of ignoring red flags about Madoff's crimes, and allegedly turning a blind eye to his massive fraud while acting as his banker.
U.S. Attorney Preet Bharara in New York City said the funds will compensate victims of Madoff, convicted mastermind of the biggest Ponzi scheme in history.
In addition to the settlement with prosecutors, JPMorgan Chase agreed to pay $350 million to the Office of the Comptroller of the Currency and another $543 million to Irving Picard, a court-appointed trustee seeking to recover lost assets for Madoff victims.
Related: Five things you didn't know about Madoff's scam
"We recognize we could have done a better job pulling together various pieces of information and concerns about Madoff from different parts of the bank over time," wrote JPMorgan spokesman Joseph Evangelisti in an e-mail to CNNMoney.
He said the bank filed a Suspicious Activity Report about Madoff's activities in the United Kingdom in 2008, but did not file a similar report in the United States.
"We do not believe that any JPMorgan Chase employee knowingly assisted Madoff's Ponzi scheme," he said.
Related: Regulator warned against JPMorgan charges
Federal documents say that from 1986 until Madoff's arrest in 2008, his Ponzi scheme "was conducted almost exclusively" through JPMorgan bank accounts. They also state that "virtually all client investments" were deposited with Chase.
As part of the deal, the bank has agreed to a deferred-prosecution agreement, which means the company can avoid criminal charges as long as it adheres to specific legal requirements for two years. At that point, the charges against JPMorgan could be dismissed entirely.
Richard Breeden, special master of the Department of Justice's Madoff Victim Fund, said that all of the $1.7 billion in the settlement with federal prosecutors is going into the fund that he controls. It brings the total in his fund to $4 billion.
Breeden said that he is still taking claims and has not yet compensated victims. His fund is separate from the approximately $10 billion in Madoff assets recovered by court-appointed trustee Picard.
Madoff swindled about $20 billion from thousands of investors who thought he was operating a legitimate Wall Street firm.
Related: Prison exclusive with Madoff, king of thieves
JPMorgan has announced a series of massive legal settlements in recent months. In November, the financial firm agreed to a $13 billion settlement over the mortgage-backed securities it sold ahead of the financial crisis of 2008.
Also in November, JPMorgan announced a separate $4.5 billion settlement with institutional investors who suffered losses on mortgage securities sold during the housing bubble.
Earlier in the year, the firm had to pay about $1 billion in fines related to the so-called "London Whale" trading snafu, and more than $400 million to settle charges that it manipulated electricity prices in California and the Midwest.
Madoff is serving a 150-year prison sentence at a federal prison in North Carolina after pleading guilty to 11 criminal counts, including fraud, in 2009, three months after his arrest.
Five of Madoff's ex-employees are currently on trial in federal court in New York for allegedly helping him conduct the scam.