The military judge presiding over the court-martial of a U.S. Navy SEAL charged with war crimes said on Friday prosecutors who electronically tracked email communications of defense lawyers without a warrant violated the accused's right to a fair trial.

The finding came near the end of a two-day hearing that wrapped up just 10 days before Special Operations Chief Edward Gallagher is due to stand trial in a case that has drawn the attention of U.S. President Donald Trump.

Gallagher is charged with murdering a helpless, wounded Islamic State fighter in his custody, and with two counts of attempted murder in the wounding of two unarmed civilians, a schoolgirl and elderly man, shot from a sniper's perch.