The District’s highest local court said Mayor Vincent C. Gray may proceed in trying to remove the city’s top administrative law judge from office, overruling a lower court’s decision that halted his efforts to fire the controversial but tenured agency head.

The D.C. Court of Appeals also said Friday that the city’s ethics board should have the opportunity to rule on Mary Oates Walker’s request to dismiss a 19-count case against her, suggesting the matter is not yet ripe for litigation in the courts.

The appeals ruling comes one week after a D.C. Superior Court judge enjoined Gray (D) and the Board of Ethics and Government Accountability from taking action against Walker and a deputy, Kiyo Oden Tyson. The board, Judge Brian F. Holeman ruled, did not have jurisdiction over “independent agencies,” including the Office of Administrative Hearings, which Walker leads. And because Gray’s move to fire Walker for cause was based mainly on the board’s findings, Holeman ruled, it also must be halted.

But Gray’s authority to fire Walker, a three-judge panel said, “is independent of any issue concerning the Ethics Board’s jurisdiction.” And the judges said the ethics board is free to rule on Walker and Tyson’s motion to dismiss the charges against them, in which they raise largely the same jurisdictional concerns that Holeman cited.

The fact that the ethics board might still drop the charges concerned the appeals panel, which gave the parties 20 days to argue whether Holeman’s ruling was premature and should be dismissed. That stands to postpone the ethics board’s scheduled trial of Walker and Tyson, which had been set to begin this month.

The ruling would appear to be a setback for Walker, who has vigorously fought the ethics charges against her since they were leveled last month. But Anthony M. Conti, an attorney for Walker and Tyson, said he was “very pleased” with the ruling, saying he was encouraged that the appeals court plans to “take a careful look at [the board]’s jurisdiction in the weeks to come.”

Walker is accused of steering a $43,000 contract to Tyson’s future husband, violating conflict-of-interest rules and lying to board investigators. Tyson is accused of 10 ethics violations. The two women, who face fines and potential sanctions that could affect their law licenses, have said they have been targeted by disgruntled junior judges at the agency.

Ted Gest, a spokesman for the D.C. attorney general’s office, which is handling the litigation, declined to comment. A spokesman for Gray did not return a phone call or e-mail seeking comment.

For the board, there is much at stake, with Holeman’s ruling threatening to significantly reduce the enforcer’s bailiwick.

In papers asking the appeals court to intervene, attorneys for the city said the board “cannot proceed with approximately 20% of its current cases and will not be able to initiate new investigations for the employees of approximately 30 independent agencies and hundreds of excepted service employees.”

Independent agencies are those branches of city government that are not subject to the direct control of the mayor. “Excepted service” employees are typically in high-level posts appointed by the mayor.