The lead Navy prosecutor in the war crimes case against a decorated Navy SEAL has been removed from the case by the judge for spying on defense teams and a Navy Times journalist.

Navy Cmdr. Christopher Czaplak was ordered off the case against Special Warfare Operator Chief Edward “Eddie” Gallagher by the judge, Navy Capt. Aaron Rugh, on Monday after Czaplak admitted emailing 13 defense attorneys and paralegals, as well as Navy Times editor Carl Prine, a tracking beacon in an effort to find the source of leaks to the media.

The defense attorneys have asked the judge to dismiss the charges against Gallagher or remove prosecutors because of the surreptitious effort to track defense emails without court approval.

Brian O’Rourke, a spokesman for Navy Region Southwest, confirmed in an email to Navy Times Monday evening that Czaplak was removed from the case.

The Navy is complying with the judge’s order, said O’Roarke.

“The senior trial counsel will be replaced by a qualified military judge advocate,” he said, adding that no name has yet been introduced.

“Chief Petty Officer Gallagher is entitled to a fair trial and the Navy is committed to upholding that principal,” the Navy spokesman said.

Last week, Rugh unexpectedly released Gallagher from custody as a remedy for interference by prosecutors.

× Fear of missing out? Sign up for the Navy Times Daily News Roundup to receive the top Navy stories every afternoon. Thanks for signing up. By giving us your email, you are opting in to the Navy Times Daily News Roundup.

The removal of the prosecutor could delay the trial scheduled to start June 10.

Rugh removed Czaplak because the threat of an investigation into Czaplak could create a conflict of interest.

The judge did not make any decision on the allegations of prosecutorial misconduct.

“While it is not within the purview of this court to conclude whether actions of trial counsel violated the rules of professional responsibility, the court must determine whether the fear of, or potential danger of, a professional responsibility complaint and follow-up investigation, is sufficient to create such a conflict,” Rugh’s motion read, according to a Navy official not authorized to speak on the record. “Conceding that this area remains both nuanced and unresolved under the ethical rules, still the court concludes that the danger of investigation is sufficiently real that any trial counsel so situated might be motivated by factors unrelated to his position as trial counsel.”

Tim Parlatore, Gallagher’s attorney, said he was in the middle of a deposition when Czaplak was told to leave by Rugh as a result of the spying.

“It is certainly a partial remedy,” Parlatore told Navy Times. “We are still hoping for dismissal, but it is definitely appropriate under the circumstances. Prosecutors should not be doing this. Chris Czaplak should have known better before taking the unlawful actions that he did.”

In a court hearing last month, Czaplak said the code embedded in the emails recorded nothing more than where and when messages were opened by recipients. It was part of an NCIS investigation into unauthorized leaks to the media.

Czaplak said the tracking ended May 10 after he was confronted by defense lawyers who discovered the code secretly embedded in an unusual logo of an American flag with a bald eagle perched on the scales of justice beneath Czaplak’s signature.

In court, Czaplak said the code was similar to what marketers use to see when an email is opened and on what device.

Czaplak did not immediately return an email seeking comment.

NCIS witnesses refuse to take the stand in SEAL war crimes case, judge mulls dismissing all charges Navy judge Capt. Aaron Rugh unexpectedly released Gallagher from custody on Thursday as a remedy to what he called interference by prosecutors.

The fall of the lead prosecutor in the most prominent Navy war crimes case in generations was as swift as it was stunning.

Czaplak had shepherded the case since the Sept. 11, 2018, arrest of Gallagher, 40, at Camp Pendleton, where Gallagher was receiving medical care for traumatic brain injury. On Friday, Czaplak had submitted written answers to a series of questions posted by Parlatore, who accused Czaplak of helping to orchestrate a warrantless search operation against other attorneys and the editor of Navy Times.

Shortly after testimony wrapped up, however, the U.S. Attorney’s office in San Diego forwarded a letter to Rugh alerting the judge that the Department of Justice had little input into the affair and didn’t even realize that NCIS and the prosecution team had kicked it off with a flurry of emails to defense attorneys and the Navy Times that were embedded with a tracking beacon. Allegedly designed to help ferret out leaks, critics argued the tracking beacon could be used to unlawfully surveil defense teams and reporters.

Last week, officials announced in court that the Marine Corps had withdrawn Capt. Conor McMahon, an assistant prosecutor, from the case.

Rugh’s latest ruling did not mention the fate of the third prosecutor, Navy Lt. Brian John.

Prosecutors, NCIS investigator accused of ‘misconduct’ in war crimes case The SEAL is accused of stabbing to death an unarmed and seriously wounded Islamic State prisoner of war during a 2017 deployment to Iraq, plus shooting an old man and a young girl in a violent spree that prosecutors contend might have claimed hundreds of lives.

Rugh has yet to rule on other motions seeking to dismiss the case because of both prosecutorial misconduct an unlawful command influence by senior Navy leaders.

But NCIS witnesses and officials in Washington have said the probe continues.

Rugh said it was not in his power to determine prosecutorial misconduct, but there was the possibility of a conflict of interest that required Czaplak to be removed, the ruling said.

Rugh has not yet ruled on whether to dismiss murder and attempted murder counts against Gallagher.

The Associated Press contributed to this report.