A federal judge held veteran investigative reporter Catherine Herridge in civil contempt on Thursday for refusing to divulge her source for a series of Fox News stories about a Chinese American scientist who was investigated by the FBI but never charged.

U.S. District Judge Christopher Cooper in Washington imposed a fine of $800 per day until Herridge complies, but the fine will not go into effect immediately to give her time to appeal.

Cooper wrote that he “recognizes the paramount importance of a free press in our society” and the critical role of confidential sources in investigative journalism. But the judge said the court “also has its own role to play in upholding the law and safeguarding judicial authority.”

“Herridge and many of her colleagues in the journalism community may disagree with that decision and prefer that a different balance be struck, but she is not permitted to flout a federal court’s order with impunity,” wrote Cooper, who was nominated to the bench by former President Barack Obama.

A lawyer for Herridge, Patrick Philbin, declined to comment. Representatives for CBS and Fox News did not immediately respond to emails seeking comment.

The source is being sought by Yanpin Chen, who has sued the government over the leak of details about the federal probe into statements she made on immigration forms related to work on a Chinese astronaut program.

Herridge, who was recently laid off by CBS News, published an investigative series for Fox News in 2017 that examined Chen’s ties to the Chinese military and raised questions about whether the scientist was using a professional school she founded in Virginia to help the Chinese government get information about American servicemembers.

The stories relied on what her lawyers contend were items leaked from the probe, including snippets of an FBI document summarizing an interview conducted during the investigation, personal photographs, and information taken from her immigration and naturalization forms and from an internal FBI PowerPoint presentation.

Chen sued the FBI and Justice Department in 2018, saying her personal information was selectively leaked to “smear her reputation and damage her livelihood.”

The judge had ordered Herridge in August to answer questions about her source or sources in a deposition with Chen’s lawyers. The judge ruled that Chen’s need to know for the sake of her lawsuit overcomes Herridge’s right to shield her source, despite the “vital importance of a free press and the critical role” that confidential sources play in journalists’ work.

Herridge was interviewed under oath in September by a lawyer for Chen, but declined dozens of times to answer questions about her sources, saying at one point, “My understanding is that the courts have ruled that in order to seek further judicial review in this case, I must now decline the order, and respectfully I am invoking my First Amendment rights in declining to answer the question.”

Philbin, who served as deputy White House counsel during the Trump administration, has said that forcing Herridge to turn over her sources “would destroy her credibility and cripple her ability to play a role in bringing important information to light for the public.”

Philbin also told the judge that disclosing the identity of Herridge’s sources raises national security concerns, writing in court papers that there is a “serious risk” that Chen “was involved in making information about U.S. military members available” to the Chinese.

Legal fights over whether journalists should have to divulge sources are rare, though they’ve arisen several times in the last couple decades in Privacy Act cases like the one filed by Chen. Some lawsuits have ended with a hefty Justice Department settlement in place of a journalist being forced to reveal a source, an outcome that remains possible in Herridge’s case.

In 2008, for instance, the Justice Department agreed to pay $5.8 million to settle a lawsuit by Army scientist Steven Hatfill, who was falsely identified as a person of interest in the 2001 anthrax attacks. That settlement resulted in a contempt order being vacated against a journalist who was being asked to name her sources.