CBS/Screenshot by CNET

A New Zealand appeals court ruled Wednesday that the search warrants used during the raid of MegaUpload founder Kim Dotcom's mansion as part of an online piracy probe were legal, dealing a setback to his fight to avoid extradition.

The decision overturned much of a June 2012 ruling invalidating the warrants used in the January 2012 raid on Dotcom's mansion near Auckland, New Zealand. While a High Court judge said at the time that the warrants did not adequately describe the offenses alleged, a three-judge panel found Wednesday that the warrants were "defective in some respects" but not enough to render them invalid, according to an AFP account of proceedings.

"This really was a case of error of expression. The defects were defects in form not in substance," the judges said in a 44-page written judgment. "No more items were seized than would have been without the defects in the search warrants."

Dotcom, 40, was arrested in January 2012 at the mansion he leases near Auckland after the US handed down an indictment on criminal copyright violations and racketeering charges related to the operation of cloud-storage locker MegaUpload. Laptops, hard drives, and millions of dollars worth of cash, cars, and other possessions belonging to Dotcom were seized during the raid on his estate.

US officials, who are trying to extradite Dotcom and three of his associates, say he cost Hollywood studios and other copyright owners $500 million by encouraging users to store pirated videos, music, software, and other media and then share them with others. Dotcom, who faces up to 20 years in prison if convicted, denies the charges and claims MegaUpload was completely legitimate and protected by the Digital Millennium Copyright Act.

While overturning the earlier court ruling that the warrants were vague, the court did uphold the portion of the June 2012 ruling that found it was unlawful for cloned hard drives of the data confiscated in the raid to have been sent to prosecutors in the US.

Dotcom's legal team said it would likely appeal Wednesday's ruling to the Supreme Court.

"Our @KimDotcom legal team is reviewing the rulings made by the Court of Appeal and will likely seek leave to appeal to the Supreme Court," San Francisco-based attorney Ira Rothken said in a tweet.

Dotcom is free on bail ahead of an extradition hearing scheduled for April.