JPMorgan Chase agreed to a deal that will return $546 million to former customers of trading firm MF Global Holdings Ltd., which collapsed in 2011 with $1.6 billion missing from its accounts.

MF Global failed in October 2011 after a calamitous bet on European debt spooked its investors, partners and clients.

The bankruptcy was the eighth-largest in the U.S. and the largest on Wall Street since the 2008 collapse of Lehman Brothers. Much of the missing money belonged to farmers, ranchers and other business owners who used MF Global to reduce their risks from fluctuating prices of commodities such as corn and wheat. A House panel has said credit rating agencies and federal regulators contributed to MF Global’s collapse. But it pinned most of the blame on risky strategies by ex-CEO Jon Corzine, the former New Jersey governor.

JPMorgan held MF Global funds in several accounts and also processed the firm’s securities trades. The trustee tasked with getting customers’ money back, James W. Giddens, threatened to sue the New York bank if it didn’t return money that was transferred to the bank from MF Global. By June 2012, JPMorgan had returned $608 million to the firm.

Under a settlement agreement filed Tuesday in Manhattan bankruptcy court, JPMorgan Chase has agreed to pay $100 million to reimburse customers and will relinquish claims on $417 million that it previously returned. JPMorgan also will return over $29 million that it is holding as security on an MF Global credit line. The recovered money will eventually be passed along to customers.

The bank doesn’t comment on the reserves it sets aside to pay for specific legal cases. But it said the settlement would not have a material impact on its results.

Bank spokeswoman Jennifer Zuccarelli said the bank was pleased to reach the settlement, which would help restore funds to MF Global’s customers.

“As we have said before, JPMorgan worked to assist our client in a responsible manner under very challenging circumstances,” she added.

The deal must be approved by Bankruptcy Court Judge Martin Glenn and District Court Judge Victor Marrero.