Owners of the New York Mets baseball team have agreed to pay $162 million to settle a lawsuit by the trustee seeking money for victims of Bernard Madoff's fraud, just before a trial was scheduled to begin.

The settlement was announced in Manhattan federal court by U.S. District Judge Jed Rakoff on Monday. Payments by the team are expected to occur over several years.

Irving Picard, the court-appointed trustee, had accused Mets owners Fred Wilpon and Saul Katz of ignoring warning signs that Madoff was running a fraud during their 25 years of investing with him.

The owners countered that they did not know Madoff was running a Ponzi scheme.

On March 5, Rakoff had ruled that the owners must repay as much as $83.3 million of fictitious profit from Madoff's firm. The trial was expected to consider whether they should return an additional $303 million.

A hearing to consider final approval of the settlement is set for April 13. Picard and the Mets owners will work on details with former New York Governor Mario Cuomo, who has been mediating the dispute.

The case is Picard v. Katz et al, U.S. District Court, Southern District of New York, No. 11-03605.

(Reporting By Grant McCool; Additional reporting by Jonathan Stempel; Editing by Gerald E. McCormick and Maureen Bavdek)