Lawyers for a Navy SEAL accused of killing an Islamic State prisoner in Iraq in 2017 want the case thrown out because of alleged prosecutorial misconduct that include withholding evidence and conducting surveillance on the defense.

Attorneys for Special Operations Chief Edward Gallagher plan to ask a military court Wednesday in San Diego to dismiss the case or remove the prosecutor and, possibly, have the judge himself step aside.

"Gallagher's case has been irreparably corrupted by a government campaign of outrageous and illegal conduct," attorney Tim Parlatore said in the opening salvo of his motion to dismiss the charges. "This prosecution threatens to make an unequivocal farce of our justice system."

The motion comes with Gallagher's trial less than two weeks away and amid mounting pressure from the defense after lawyers discovered prosecutors planted tracking software in emails sent to the defense team and a journalist that may have violated attorney-client privilege and other constitutional rights.

The Navy has said it did nothing wrong and has no plans to remove the prosecutor. A spokesman wouldn't comment on the motions.

Among the evidence apparently kept from the defense were results of a polygraph exam Gallagher was given weeks before his arrest on charges that he fatally stabbed an injured young teenage militant and picked off civilians from a sniper's perch.

Gallager knew at the time he was under investigation and denied committing any war crimes during the test, Parlatore said in court papers. Gallagher was told he passed the exam.

Parlatore said he only knows about the exam because his client told him about it and investigation documents showed efforts to schedule the test.

Polygraphs, commonly referred to as lie-detector tests, are not admissible in civilian or military courts because they are "not an indication of truth," said Gary Solis, a former military judge and Marine Corps prosecutor who teaches law at Georgetown.Passing such a test means the person answered most of the key questions without any indication of lying.

It's debatable whether the results would be considered evidence of innocence, and therefore the prosecution would not necessarily have to turn them over to the defense, Solis said.

The judge could admonish the defense for revealing polygraph results because it could taint the jury in the case, Solis said.

The effort to get the case thrown out comes as President Donald Trump has considered pardoning several service members accused of war crimes, including Gallagher, who has pleaded not guilty.

Gallagher's family has lobbied vigorously for his freedom and dozens of Republican lawmakers have rallied to his cause.

Prosecutors have said Gallagher stabbed the injured militant and then posed for a photo with his corpse for his re-enlistment ceremony. He sent a text to fellow SEALs later saying, "I got this one with my hunting knife."

Parlatore dismissed that as a joke that reflects the dark humor of a warrior. No blood was found on the knife by forensics experts, he added.

Parlatore said he's aware of evidence that showed at least one member of Gallagher's squad practiced medical procedures on the militant when he was dead or nearly dead, which might indicate he died from a different cause.

He said witnesses would be willing to testify to that, but prosecutors have said they're unaware of anything performed on him that was not medically necessary or any alternative cause of death.

GET THE FOX NEWS APP

Parlatore also claimed that prosecutors can't prove that Gallagher shot a young girl and old man because charges of attempted murder are based only on rumors and inadmissible hearsay.

Gallagher faces trial June 10.