A federal judge ruled Tuesday that he will not publicly disclose details of an immunity agreement between a former aide to Hillary Clinton and Justice Department prosecutors that had been sought by a conservative legal advocacy group in a lawsuit against the State Department.

Judge Emmet G. Sullivan sided with prosecutors who had sought to seal details of their immunity deal with Bryan Pagliano, a former State Department staffer and private computer security consultant who oversaw the operations of Clinton's private email server. Sullivan also ruled Tuesday that an upcoming deposition of Pagliano by lawyers for the conservative legal group Judicial Watch would be videotaped but remain temporarily sealed.

The judge cited the government's criminal investigation of Clinton's server in withholding the details of Pagliano's immunity deal. "The privacy interests at stake are high because the government's criminal investigation through which Mr. Pagliano received limited immunity is ongoing and confidential," Sullivan wrote in his brief order.

Pagliano's lawyers have said that their client will invoke his Fifth Amendment right against self-incrimination. Pagliano is cooperating with the FBI in its investigation of Clinton's server, which was used by the presumptive Democratic nominee for president to conduct all her official business during her four-year tenure as secretary of state in the Obama administration.

In an earlier motion against revealing the details of Pagliano's immunity deal, government lawyers warned that "releasing Mr. Pagliano's agreements with the United States could prematurely reveal the scope and focus of the pending investigation."

Pagliano's lawyers had also asked that his immunity deal be sealed and sought a protective order prohibiting any videotaping of his future deposition. Sullivan ruled against Pagliano on the question of the deposition, saying "Mr. Pagliano's deposition shall be videotaped and the audiovisual of his deposition shall be sealed until further order of the court."

Judicial Watch sought the details of Pagliano's deal and his videotaped testimony as part of its lawsuit against the State Department related to agency records of former Clinton aide Huma Abedin's role as a paid consultant for the Clinton Foundation, the Clinton family's global charity operation.

There have been at least three dozen records-related lawsuits filed against the State Department, including one currently litigated by The Associated Press, all stemming from Clinton's term at the agency between 2009 and 2013.