(JTA) — The owners of the New York Mets will pay up to $162 million to settle a “clawback” lawsuit filed in the Bernard Madoff Ponzi scheme.

Fred Wilpon and his brother-in-law Saul Katz will not have to make payments for three years under the agreement.

The lawsuit was settled Monday morning in Manhattan Federal Court just hours before jury selection was set to begin in the civil trial.

Irving Picard, the trustee charged with recovering billions of dollars in assets stolen in Madoff’s scheme, filed the lawsuit seeking more than $300 million that Wilpon and Katz allegedly made through the scam. A ruling blocked Picard from trying to collect the full $1 billion he sought to recoup.

Picard said the team owners knew that Madoff’s investments were a sham but continued to invest because of the large returns. Lawyers for Wilpon and Katz said their clients had no idea the investments were fraudulent.

Picard has filed hundreds of similar lawsuits seeking to regain money from those who profited the most from the scheme. The money will go into a fund to help victims of Madoff’s scheme.

Madoff pleaded guilty to fraud charges three years ago in the more than $17 billion scheme. Picard reportedly has recovered about $11 billion of the invested principal lost in the scheme.

The Mets’ owners had to sell part of the National League team and have had to cut its payroll because of the ramifications of the scheme and lawsuit.