In a sharp rebuke to independent counsel Lawrence E. Walsh, a federal appeals court yesterday dismissed a contempt citation against arms dealer Albert A. Hakim for refusing to surrender the records of eight foreign companies linked to the Iran-contra affair.

Handing Walsh his first court defeat, a three-judge panel of the U.S. Circuit Court of Appeals here held that a lower court had erred in rejecting Hakim's Fifth Amendment claims that he might incriminate himself by complying with a grand jury subpoena for the records.

The 32-page ruling sent the case back for further hearings before U.S. District Court Judge Aubrey Robinson, who ordered Hakim jailed for civil contempt last July 30. Hakim's appeal stayed execution of the order.

The appeals court judges said Robinson was wrong in holding that he could enforce the subpoenas simply because he had personal jurisdiction over Hakim. In remanding the case for further hearings, the panel said that Walsh "must show that the district court has personal jurisdiction over each of the companies whose records it seeks . . . .

"The mere fact that the {district} court has jurisdiction over an alleged representative of the companies is patently insufficient to establish jurisdiction over the companies or to entitle the independent counsel to view company documents."

Using unusually harsh language, the unanimous ruling, written by Circuit Court Judge Jarry T. Edwards, said Walsh had even failed to establish that Hakim was the custodian of the subpoenaed records.

"By any measure that might reasonably be extracted from Supreme Court precedents, the independent counsel's offer of proof is woefully inadequate," the panel said. The two other members were Supreme Court nominee Douglas H. Ginsburg and James L. Buckley.

Walsh's staff had given Judge Robinson a sealed affidavit that purportedly showed Hakim's custodial relationship to the eight companies. But the appeals court said the affidavit, "if given credence, only ties the witness to three of the eight companies by way of a single, uncorroborated assertion by an unnamed source, while offering scant additional proof of his connections to three others."

Hakim refuses to concede that the documents exist, let alone that he possesses them.

The April 30 subpoena directed Hakim, in his capacity as "custodian," to produce corporate minutes, telephone logs and other documents pertaining to the operations of eight foreign firms that he allegedly controlled. Prosecutors argued that Hakim's Fifth Amendment rights against self-incrimination did not extend to corporate records and that he was obliged to produce them or designate someone to do so.

One of four publicly named targets of Walsh's criminal investigation, Hakim was the business partner of retired Air Force major general Richard V. Secord and served as financier and negotiator for many phases of the U.S.-Iran arms-for-hostage schemes. He played a key role in setting up Swiss bank accounts as a repository for the arms sales profit.

Yesterday's ruling came three days after Switzerland turned over more than 2,000 pages of bank records from Iran-contra accounts involving Hakim and others to Walsh's investigators.

Walsh and his prosecutors had argued that Hakim had a "duty" -- as a U.S. citizen -- to comply with the subpoena. The appeals court judges rejected this argument out of hand, calling the idea "utterly baseless as an assertion about our law."

On the issue of self-incrimination, the appeals panel said Hakim can "properly invoke his Fifth Amendment privilege" if he can show Judge Robinson that the act of producing the records -- by establishing his possession or control of them, or by showing their authenticity -- might tend to incriminate him.

If Hakim can make such a showing, the court said, then Walsh must either demonstrate that such incriminating admissions are "a foregone conclusion," or he must give Hakim immunity for "the testimonial implications of his production of the documents."

Walsh issued a terse statement saying that "the opinion of the court is being studied and a prompt decision will be made as to the appropriate way in which to proceed."

Hakim's lawyer, N. Richard Janis, called the decision "a victory not only for Mr. Hakim but for all citizens who are entitled to protection under the Fifth Amendment from prosecutorial overreaching. It affirms that no matter how important a prosecutor may believe his investigation is, he must still comply with the law."