The prosecution in the high-profile war crimes case of Navy SEAL Edward Gallagher allegedly sent emails containing hidden tracking software to defense attorneys and a reporter.

The peculiar emails were apparently sent as part of an ongoing investigation into media leaks, but the use of these types of cyber tools are ethically questionable and potentially illegal.

An advocate for press freedom told Military Times that this is the first time he has ever heard of the military engaging in this type of behavior.

Visit INSIDER's homepage for more stories.

In a potentially unprecedented violation of privacy, a Navy prosecutor is suspected of spying on the media in an attempt to find leaks in a major war crimes case.

Special Operations Chief Gallagher Edward Gallagher will soon stand trial for stabbing an unarmed ISIS militant to death in Iraq in 2017, as well as shooting two civilians. The Navy SEAL's defense team recently brought forward allegations that the prosecution sent emails with embedded tracking software to 13 lawyers and paralegals affiliated with the case.

Emails were also sent to attorneys for Lt. Jacob Portier, who allegedly conducted a re-enlistment ceremony for Gallagher next to the body of the very ISIS fighter Gallagher is accused of murdering.

Read more: Lawyers for Navy SEAL accused of war crimes say military prosecutors spied on their emails

The emails sent by Navy prosecutor Cmdr. Christopher Czaplak contained an unusual image of the American flag with a bald eagle sitting atop the scales of justice, an image that had not appeared in previous emails.

While most of the recipients were members of Gallagher and Portier's defense teams, one of these peculiar emails was sent to a Carl Prine, a reporter at Navy Times who has broken several important stories related to the case. Czaplak, according to Tim Parlatore, one of Gallagher's attorneys, recently admitted to sending the emails before a military judge.

The emails with the tracking software are suspected to have been sent as part of an ongoing NCIS investigation into leaks to the media, as the case is covered by a gag order imposed by Navy Judge Capt. Aaron Rugh. Still, certain sensitive documents have been leaked to the press.

"It is illegal for the government to use [the emails] in the way they did without a warrant," Parlatore said to Military Times, parent company for Navy Times. "What this constitutes is a warrantless surveillance of private citizens, including the media, by the military. We should all be terrified."

The Navy explained to Military Times that the media was and is not the target of the investigations. The embedded image in the email sent by the prosecution reportedly contained a "splunk tool," a kind of cyber tool capable of facilitating external access to a compromised computer and the files stored within, although there is the possibility the tracking software in the emails may have been more benign.

The prosecution is suspected of pursuing IP addresses and other relevant metadata, information which can only be pursued with a subpoena or court order.

While such behavior is decidedly unethical in the legal world, the targeting of reporters may be without precedent. "This is the first case I am aware of that something like this has happened," Gabe Rottman, the director of the Technology and Press Freedom Project at the Reporters Committee for Freedom of the Press, told Military Times. "If a prosecutor sent an email to a reporter with a tracking device intending to identify a leak, that is certainly concerning."

"If it is true that a government official included tracking software in an email to a reporter surreptitiously to find out who the reporter is talking to, that potentially exposes that reporter's other sources in totally unrelated cases to government scrutiny," he added.

In response to the alleged actions of the prosecution, Parlatore is filing a motion to dismiss the case, as well as a motion to disqualify Czaplak from prosecuting the case. It remains to be seen if there will be any legal backlash to deal with the suspected blow to press freedom.