The owners of the New York Mets and the trustee handling the massive Bernard Madoff fraud jointly announced an agreement Tuesday in which the owners get more time to pay off a $61 million debt, some of which is due on Wednesday.

A group including Fred Wilpon and Saul Katz originally owed trustee Irving Picard a total of $162 million after settling an acrimonious legal battle in 2012, in which the trustee said that the team owners were willfully blind to Madoff’s giant fraud when they reaped some fictitious profits from his operation, something the partners denied.

Under the intricate math of the new settlement, the Katz-Wilpon people had the debt reduced by payments Picard has been making over the years to Madoff victims in the Ponzi scheme. It was expected under the original settlement that the debt would be paid off by June 1, 2017.

But even with the accelerating pace of the repayments to investors, there was still a shortfall which left the Mets group owing $61 million going into June 1.

Under the revised settlement, the Katz-Wilpon group will only have to repay $16 million on June 1, instead of $23 million. The remainder, currently around $45 million, will be divided in four annual installments from 2017 to 2020. Originally, the remaining debt needed to be paid off by June 1, 2017.

The Katz-Wilpon group agreed under the new settlement to pay Picard 3.5 percent interest on the remaining balance. Saul Katz and Fred Wilpon have also now agreed to personally guarantee the balance, according to the statement.