LOS ANGELES — Military prosecutors in the case of a Navy SEAL charged with killing an Islamic State prisoner in Iraq in 2017 installed tracking software in emails sent to defense lawyers and a reporter in an apparent attempt to discover who was leaking information to the media, according to lawyers who told The Associated Press that they received the corrupted messages.

The defense attorneys told The Associated Press the intrusion may have violated constitutional protections against illegal searches, guarantees of lawyer-client privilege and freedom of the press, and may constitute prosecutorial misconduct.

"I've seen some crazy stuff but for a case like this it's complete insanity," said attorney Timothy Parlatore. "I was absolutely stunned ... especially given the fact that it's so clear the government has been the one doing the leaking."

Parlatore represents Special Operations Chief Edward Gallagher, who has pleaded not guilty to a murder count in the death of an injured teenage militant he allegedly stabbed to death in 2017 in Iraq. Gallagher’s platoon commander, Lt. Jacob Portier, is fighting charges of conduct unbecoming an officer for allegedly conducting Gallagher’s re-enlistment ceremony next to the corpse.

Military judge airs concerns about media leaks in Navy SEAL’s war crimes case A military judge has asked the Navy to address claims that material was being leaked to the media in the case of a SEAL charged with murder in the 2017 death of an Iraqi war prisoner, saying it could impact the trial.

The case against Gallagher, a decorated SEAL, has attracted the attention of congressional Republicans who have called for prosecutors to drop the case. And President Donald Trump tweeted in March that Gallagher was being transferred to less restrictive confinement to honor “his past service to our country.”

After Trump's tweet, Gallagher was moved from the brig to Naval Medical Center San Diego, where he is currently confined.

The Navy has previously acknowledged it’s investigating document leaks and said it had limited the number of people who have access to the information. Defense lawyers said the leaks appear to be coming from the government because they’ve learned about some information from news media before they received documents from prosecutors — and the information has not helped their clients.

× 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.

Attorneys for Portier on Monday asked a military judge to force prosecutors to turn over details identifying who authorized the monitoring, what they were seeking and how far the monitoring went.

Embedding emails with "devices designed to monitor defense communications" implicates Portier's right to counsel and right against unreasonable search and seizure, wrote Air Force Lt. Col. Nicholas McCue, one of Portier's defense lawyers. He said he wanted to make sure the measure didn't violate the confidentiality of Portier's communications with his attorney.

Ret. Lt. Col. Gary Solis, who teaches law at Georgetown and as a Marine Corps lawyer prosecuted some 400 cases and was a judge on more than 300 others, said he had never heard of hidden cyber tracking software sent to defense lawyers by prosecutors.

"Not only is it ethically questionable, it may be legally questionable," Solis said. "When it's apparently so easily discoverable when done in an ineffectively haphazard manner ... it's questionable on an intellectual level."

Prosecutors celebrate victory after ruling in Gallagher war crimes case A Navy judge ruled that evidence from Gallagher's seized cell phones can be used in court.

The prosecutor, Cmdr. Christopher Czaplak, declined to comment Monday.

Navy spokesman Brian O'Rourke said an investigation into leaked documents is ongoing and it was inappropriate to comment.

Navy prosecutors have said Gallagher during his eighth deployment indiscriminately shot at Iraqi civilians and stabbed to death a captured Islamic State fighter estimated to be 15 years old. He also posed with the teen's corpse at his re-enlistment ceremony, prosecutors said.

Gallagher's lawyers have said the allegations were made by disgruntled SEALs out to get Gallagher because he was a demanding leader.

Gallagher faces trial May 28 and Parlatore said prosecutors should focus on that and not on sending communications intended at spying on defense lawyers.

The emails were sent Wednesday to 13 lawyers and paralegals on their team — and to Carl Prine, a reporter for the Navy Times newspaper.

Prine has reported extensively on the case and has broken several stories based on documents provided by sources.

While documents are subject to a court order not to be shared, none has been classified, Prine said.

“These allegations, if true, are a troubling assault on journalists and the work we do," said Andrew Tilghman, the executive editor for Military Times, which includes Navy Times.

“These are not classified documents that we’re talking about, so it’s especially disturbing to hear that the federal government is taking these extreme measures to secretly surveil the activities of our reporter and violate their constitutional rights against unlawful search. This is potentially unlawful and should be thoroughly investigated.”

The tracking software was discovered almost immediately by defense lawyers who couldn't help but notice an unusual logo of an American flag with a bald eagle perched on the scales of justice beneath the signature of Czaplak. It was not an official government logo.

Parlatore said suspicious tracking software was embedded in the logo. He contacted Czaplak to make sure his email had not been hacked.

"I can't imagine you'd be trying to track defense attorneys' emails," Parlatore said he told Czaplak. "I want to make sure your system hasn't been compromised."

He said Czaplak told him he would check on it.

Two days later, during a closed-door meeting with the judge in San Diego, the defense pushed for more answers and the prosecutor acknowledged sending something as part of an investigation, but declined to elaborate, Parlatore said.

The defense lawyers want to know if the software recorded the time and location where they opened the email and who they may have forwarded it to — or if it was more intrusive and installed malware on their computers and possibly gave prosecutors access to other files.

David Glazier, a professor at Loyola Law School and Navy veteran, said the ploy had opened the door for the defense to seek getting prosecutors booted from the case and having it dismissed for prosecutorial misconduct.

They also risked tainting public opinion of a case that's already politically charged.

"If there ever was a case where the prosecution should be toeing the line to keep their conduct above board, this would be it," Glazier said.

McCue, one of Portier's lawyers, said he notified Air Force cybersecurity experts who recommended he stop sending privileged emails through a military communications system designed for sensitive, but non-classified materials.

Further, because they don't know the extent of the monitoring, McCue said Air Force defense lawyers had to take action to prevent communications with defendants in hundreds of cases from being compromised.

The tactic has effectively sidelined Prine, who said he's in a "really weird position" as the possible target of the investigation and can't report on the case because his objectivity could be questioned. He's also concerned about his sources and wants to know what else the government might be intercepting.

"This is a novel thing. We hadn't considered this before — a Trojan horse they put on the system to do this," Prine said. "What else is in our system? What's on my phone? ... Are they listening now?"

Associated Press writer Julie Watson in San Diego contributed to this report. Military Times staff also contributed to this report.