A military appeals court has sharply rebuked the former commandant of the Marine Corps, saying now-retired Gen. James Amos committed “an unusually flagrant example” of unlawful command influence in an infamous 2011 Taliban corpse desecration case.

A lawyer in the case said he believes it is the first time in history that a member of the Joint Chiefs of Staff has been judged guilty of unlawful command influence (UCI). Prohibiting UCI in the armed forces’ hierarchical structure is a bedrock of military justice.

The U.S. Navy-Marine Corps Court of Appeals threw out the conviction of Staff. Sgt. Joseph W. Chamblin, based on evidence of judicial interference by Gen. Amos and his headquarters’ legal staff.

A sniper in Afghanistan, Sgt. Chamblin was one of four Marine snipers who stood over the dead Taliban and urinated on them. A video surfaced on YouTube in 2012, spurring a rush led by the commandant himself to prosecute the Marines.

The ruling last week vindicates staff attorneys at the Marine Corps base in Quantico, Virginia. They mounted a protest to expose the actions of Gen. Amos and his chief legal adviser, Robert D. Hogue. The Corps removed both staff judge advocates and investigated one, Maj. James Weirick, who ended up leaving the Marines.

“Broadly, this ruling confirms that the highest-ranking officer in the Marine Corps broke the law. No military appeals court has ever before found a service chief unlawfully influenced a court-martial. It is unprecedented in the history of military justice,” said former Marine judge advocate L. Lee Thweatt.

Mr. Thweatt had rallied other former judge advocates to protest Gen. Amos‘ actions.

The appeals decision does not spell out why Gen. Amos believed it was a top priority to convict the Marines.

His interference began in July 2011, when he met in the Middle East with Lt. Gen. Thomas Waldhauser, who was overseeing the case. He ordered Gen. Waldhauser — now a four-star general in charge of U.S. Africa Command — to “crush” the accused Marines.

Gen. Amos had sudden remorse. He tried to rectify his order by removing Gen. Waldhauser as the overseer.

But the appeals court said that did not remedy the stain, noting that during judicial proceedings at Quantico, Gen. Amos‘ staff refused to disclose to the defense why Gen. Waldhauser was removed.

Said the 3-0 appeals court ruling: “The highest-ranking officer in the Marine Corps told [Gen. Waldhauser] that the appellant and his co-accuseds should be ‘crushed.’ This is an unusually flagrant example of UCI. We find that UCI this direct, and occurring at this level, is highly corrosive to public trust in this proceeding.”

The appeals court cited other examples.

Mr. Hogue, who is now top civilian legal adviser to Marine Gen. Robert B. Neller, the current commandant, ordered officials to classify on-the-scene videos, making it more difficult for defense attorneys to see them.

Gen. Amos, in a series of “Heritage” briefings, singled out the accused urinators, thereby possibly influencing jurors.

Four-star Marine commandants are more than commanders to Marines. They are often likened to God among the ranks.

Said the appeals court: “A member of the public’s confidence in the fairness of the proceedings would be eroded by the fact that the CMC [commandant of the Marine Corps] made an example of [Sgt. Chamblin’s] conduct in a brief intended for distribution to all officers and senior enlisted Marines. A member of the public would find that displaying a picture of the appellant committing an offense while the court-martial for that offense was pending — and particularly in light of the CMC’s earlier conduct in this case — evinces a disregard for the independence of those involved in the judicial process.”

Calls to Marine Corps public affairs office went unanswered. A message left at Mr. Hogue’s listed office phone number was not returned.

Revelations about unlawful command influence were flushed out thanks to an attorney who has a prominent role today.

John Dowd, who is representing President Trump in the Russia election interference investigation, was the attorney for Capt. James V. Clement, who was being tried at Quantico on charges of failing to supervised the snipers.

Mr. Dowd, apprised that Gen. Amos and his staff were interfering, began demanding documents and access to the commandant as a witness.

Suddenly, the Corps dropped the criminal case in September 2013.

“The withdrawal of the charges was another act of cowardice by the commandant, his counsel and the Judge Advocate Division of [Marine Corps headquarters] to cover up the worst case of unlawful command influence in the history of the Marine Corps, which was beginning next Wednesday to be uncovered in a hearing before the chief judge … on several motions to compel discovery,” Mr. Dowd told The Washington Times afterward.

The defense attorney said he wanted to see email traffic among the commandant, his counsel and his legal division.

“That email traffic would have revealed that [the commandant] and his lawyers had engaged in a secret, corrupt effort to rig and control the investigations and dispositions of the so-called desecration cases until Capt. Clement refused to submit to a corrupt process [of being] charged with crimes he did not commit,” Mr. Dowd said.

The Corps ordered a board of inquiry, which recommend Capt. Clement receive an honorable discharge.

Among Capt. Clement’s witnesses was Gen. John Kelly. He was then chief of U.S. Southern Command. Today he is Mr. Trump’s White House chief of staff.

Mr. Dowd told The Times on Friday “We will move, along with others, to correct the naval records and get rid of the Amos rot.”