A key case testing the constitutionality of the independent-counsel law yesterday came before a three-judge, federal appeals court panel here that appeared hostile to the post-Watergate statute.

The case, in which the Justice Department has for the first time joined in a court attack on the law, involves a challenge by three former Justice Department officials to the probe being conducted by independent counsel Alexia Morrison.

Morrison is investigating whether former assistant attorney general Theodore B. Olson misled Congress in investigations growing out of the Environmental Protection Agency Superfund scandal. Two other former Justice Department officials who have been subpoenaed by Morrison, Edward Schmults and Carol Dinkins, joined the challenge.

The law, which provides for a special court to appoint independent counsels to investigate allegations of wrongdoing by high government officials, "may well be a good idea, but that certainly doesn't surmount a constitutional attack, does it?" Judge Laurence H. Silberman said yesterday.

The law, he said, is "selective prosecution almost by definition."

Another judge on the panel, Stephen F. Williams, expressed doubts about the constitutionality of the law in a decision last month in a separate case upholding the Iran-contra counsel's authority to subpoena Lt. Col. Oliver L. North.

However, the third judge, Ruth Bader Ginsburg, appeared skeptical of claims that the framers of the Constitution would have objected to the independent counsel scheme, in which the prosecutors are appointed by special courts, as an undue encroachment on executive branch power.

Ginsburg said she thought the framers of the Constitution would have agreed with "the notion that the executive should not make the decision with respect to wrongdoing in his own house."

Unlike some other independent counsels, including Iran-contra investigator Lawrence E. Walsh and Wedtech investigator James C. McKay, Morrison has declined to accept a "parallel" Justice Department appointment, forcing the issue of the constitutionality of the 1978 Ethics in Government Act.

Among those who have entered the case in support of the law are Walsh, McKay, Congress, the American Bar Association and Common Cause. Joining Olson, Schmults and Dinkins in urging the court to strike it down are the Justice Department and former White House deputy chief of staff Michael K. Deaver, who is awaiting trial on perjury charges after unsuccessfully pursuing a similar challenge to independent counsel Whitney North Seymour Jr.'s appointment.

U.S. District Judge Aubrey E. Robinson earlier upheld the constitutionality of the statute in the first direct ruling on the issue.

Urging the court to strike down the law, Olson's lawyer, Thomas Martin, said, "No less than any monarch, this independent counsel is able to act without any accountability to the people."

The law, he said, imposes "a dual system of justice. It picks out a group of people and says, 'For you, different justice.' "

Justice Department lawyer Douglas Letter said that while the department is "in full accord" with the goals of prosecuting wrongdoing by high government officials, "this must be done within the framework that the framers provided."

But Earl Dudley, Morrison's deputy, said it was clear the law was needed by "repeated demonstrations . . . that the executive branch, when confronted with allegations of criminal misconduct at the highest levels, is disabled to act."