The trustee seeking money for victims of Bernard Madoff's Ponzi scheme suffered a big defeat on Thursday as a federal appeals court said he could not pursue billions of dollars of claims against banks accused of aiding in the fraud.

The 2nd U.S. Circuit Court of Appeals in New York said trustee Irving Picard lacked legal standing to pursue nearly $30 billion of claims against banks on behalf of customers and the bankruptcy estate of Madoff's former firm, Bernard L. Madoff Investment Securities LLC.

Among the banks that Picard sued were JPMorgan Chase & Co, Britain's HSBC Holdings Plc, Italy's UniCredit SpA, and Switzerland's UBS AG.

Chief Judge Dennis Jacobs, writing for a unanimous three-judge appeals court panel, said that as trustee, Picard "stands in the shoes" of Madoff's former firm, so he cannot press claims against third parties for aiding a fraud that the firm orchestrated.

He also rejected Picard's contention that it would be fair to let him pursue his claims on behalf of customers because that would make it more likely that they would be made whole, and that those who assisted Madoff's fraud would not reap windfalls.

"No doubt, there are advantages to the course Picard wants to follow. But equity has its limits," Jacobs wrote, adding in a footnote that "it is not obvious why customers cannot bring their own suits" against the banks.

A spokeswoman for Picard had no immediate comment.

The decision upheld a series of rulings by U.S. District Judges Colleen McMahon and Jed Rakoff in Manhattan.

The cases are In re: Bernard L. Madoff Investment Securities LLC, 2nd U.S. Circuit Court of Appeals, Nos. 11-5044, 11-5051, 11-5175 and 11-5207.

(Reporting by Jonathan Stempel; Editing by John Wallace)