A federal appeals court on Friday overturned an order that would have made former Secretary of State Hillary Clinton and her former chief of staff sit for a private deposition about her use of a private email server for government work when she served as the nation’s top diplomat.

A district court in March had granted conservative watchdog Judicial Watch its request to depose both Clinton and former chief of staff Cheryl Mills to depose them about topics related to the use of a server.

FEDERAL JUDGE ORDERS HILLARY CLINTON DEPOSITION TO ADDRESS PRIVATE EMAILS: 'STILL MORE TO LEARN' 

The case had arisen from a Freedom of Information Act (FOIA) request from Judicial Watch to the State Department. Clinton has argued that she has already answered questions about the controversy and should not have to do so again -- the matter did not result in any charges for the then-presidential candidate in 2016 after a high-profile investigation -- but D.C. District Court Judge Royce C. Lamberth said in his ruling that her past responses left much to be desired.

Judicial Watch had requested to question Clinton and Mills about the 2012 attack on the U.S. consulate in Benghazi, Libya, but was limited to questions related to their knowledge of the existence of emails and documents related to the attack.

Judicial Watch, which initiated the case in 2014, is looking for information regarding whether Clinton used her private email server to intentionally get around the Freedom of Information Act, whether the State Department acted in bad faith when they tried to settle the case years ago, and whether the department had adequately looked for records in response to Judicial Watch's initial FOIA request.

Clinton and Mills petitioned the appeals court to prevent the depositions, and it was granted by the court 3-0.

The appeals court accused the district court of having abused its discretion, having used suspicions of bad faith by the government to opening the door to what the appeals court described as “far-reaching” depositions.

HILLARY CLINTON SUGGESTS SHE'S WILLING TO SERVE IN BIDEN ADMINISTRATION: 'I'M READY TO HELP IN ANY WAY I CAN'

“The mere suspicion of bad faith on the part of the government cannot be used as a dragnet to authorize voluminous discovery that it is irrelevant to the remaining issues in a case,” the ruling said.

The initial case focused on Benghazi, and expanded with the discovery of Clinton’s private email server in 2015.

The court noted that the depositions focused on the server and her understanding of records-managements was not related to the initial issue in the FOIA -- which was whether the State Department had conducted an adequate search of records related to talking points to Ambassador Susan Rice as she went on Sunday shows after the attack.

CLICK HERE TO GET THE FOX NEWS APP

Rice said at the time that the attack was inspired by an anti-Islamic YouTube video, but that turned out to be false.

“The District Court has impermissibly ballooned the scope of its inquiry into allegations of bad faith to encompass a continued probe of Secretary Clinton’s state of mind surrounding actions taken years before the at-issue searches were conducted by the State Department,’ the ruling said.

Fox News’ Ronn Blitzer contributed to this report.