Special counsel Robert S. Mueller III departs after a 2017 meeting on Capitol Hill. (J. Scott Applewhite/AP)

A federal appeals court in Washington unanimously affirmed the validity of special counsel Robert S. Mueller III’s appointment Tuesday, rejecting a challenge brought by an associate of President Trump’s embattled longtime adviser Roger Stone.

The ruling from the U.S. Court of Appeals for the D.C. Circuit comes after Stone pleaded not guilty to charges of lying to try to conceal his efforts to learn about the release of hacked Democratic Party emails during the 2016 campaign.

The separate constitutional challenge to Mueller’s appointment was brought by Stone’s associate Andrew Miller, who has been trying to block a grand jury subpoena from the special counsel’s office. Miller was held in contempt by a lower-court judge for failing to testify before the grand jury as part of Mueller’s investigation into Russian interference in the last presidential election.

Miller’s attorney, Paul Kamenar, said Tuesday that he was disappointed with the decision from a three-judge panel and considering whether to ask the full D.C. Circuit to rehear the case or go directly to the Supreme Court.

A spokesman for Mueller declined to comment on the opinion Tuesday or to say whether the special counsel would continue to seek Miller’s testimony before wrapping up its investigation.

Two district court judges in Washington — one nominated by a Democrat, the other by Trump — had already upheld the legitimacy of Mueller’s appointment in recent rulings. The opinion issued Tuesday was the first time an appeals court panel had reviewed the special counsel’s authority.

The judges — Karen LeCraft Henderson, Judith W. Rogers and Sri Srinivasan — rejected Miller’s argument that Mueller was named to the post unlawfully. The court said the appointment is valid in part because Mueller is supervised by the attorney general and “effectively serves at the pleasure of an Executive Branch officer” confirmed by the Senate.

“Special Counsel Mueller was properly appointed by a head of Department, who at the time was the Acting Attorney General,” according to the 16-page opinion written by Rogers.

Deputy Attorney General Rod J. Rosenstein appointed Mueller in May 2017 after Trump fired James B. Comey, the FBI director. Rosenstein got involved because then-Attorney General Jeff Sessions had recused himself from matters involving Trump’s presidential campaign.

In court in November, Miller's lawyer said that his client should not have to comply with the grand jury subpoenas because the special counsel was named in violation of the appointments clause of the Constitution. Mueller has broad prosecutorial powers with little oversight, Miller's lawyer said, and should have been nominated by the president and confirmed by the Senate or tapped by the official head of the department.

The special counsel’s team told the court that the office has day-to-day independence but has to report major developments to Justice Department supervisors. Mueller is a so-called inferior officer and was properly appointed by Rosenstein, the office said.

“It is not the case that the special counsel’s office is off wandering in a free-floating environment,” government attorney Michael Dreeben said in court.

The court agreed in its ruling Tuesday that Mueller is an “inferior officer.” Once Rosenstein took over supervision of the campaign-related issues after Sessions’s recusal, the court said he had the authority to appoint Mueller.

Kamenar, Miller’s attorney, has said Stone’s indictment might make Miller’s testimony unnecessary. But he acknowledged that prosecutors might want his client’s testimony as they investigate others.

“He already told the FBI everything he knows in a voluntary, two-hour interview,” Kamenar said. “He was just a former aide to Roger, part time, handling administrative things for him, handling his website, and he did turn over a lot of documents that they asked for from his computer, etc., during the response to the subpoena, so they had all that information, which was essentially not much of anything.”

The case at the D.C. Circuit was argued one day after Trump ousted Sessions as attorney general. The Senate this month confirmed new Attorney General William P. Barr, who will now supervise Mueller.

At his confirmation hearing, Barr told senators he “understands the need for independence and the importance” of protecting Mueller from interference. But he did not commit to releasing the final report generated by the special counsel’s investigation.

Spencer S. Hsu and Matt Zapotosky contributed to this report.