The New York Mets can stop worrying about legal problems and focus on getting back to a .500 season after team owners reached a $162 million settlement in a suit brought by a trustee for Bernie Madoff’s fraud victims. The deal came hours before Monday’s jury selection was set to begin.

According to the original suit, brought by trustee Irving Picard, principal Mets owners Fred Wilpon and Saul Katz knew that Madoff was defrauding clients, but continued investing with him for 25 years. Wilpon and Katz said they had no idea Madoff was running a Ponzi scheme.

U.S. District Judge Jed Rakoff had blocked Picard’s initial request for $1 billion but ruled March 5 that the owners must repay as much as $83.3 million of profits from Madoff. If the trial had proceeded, the owners could have been liable for up to $303 million. Under the terms of the settlement, repayment will not start for three years.

Ultimately, the owners will likely pay less than $162 million—as Madoff victims, they are eligible to collect a percentage of any funds that Picard recovers. “In a sense, we’re now partners,” said David J. Sheehan, an attorney for Picard.

Still, the Mets start the season with a reduced roster, after slashing the payroll by $50 million.  And it remains to be seen whether ticket sales will be enough to cover $430 million worth of loans, which are due in 2014.