WASHINGTON — The Marine Corps commandant’s uncompromising talk against sexual assault looked like unlawful command influence, a military appeals court said Thursday, as it overturned a Parris Island enlisted man’s conviction on sexual assault charges.

The high-profile ruling by the U.S. Navy-Marine Corps Court of Criminal Appeals frees former Staff Sgt. Steve Howell. The ruling also casts stark light on the unforeseen consequences that have ensued from high-level Pentagon and congressional attention to the problem of sexual assault in the military.

“We’re ecstatic,” Howell’s attorney, C. Edward Massey, said in an interview Thursday. “I think this was the right thing to do.”

The decision by the three-judge appellate panel is the latest, and in some ways most dramatic, fallout from a series of remarks given in 2012 by the commandant, Gen. James Amos. Pressed by Congress, Amos delivered a round of talks in which he urged tough action against sexual assault in the ranks.

Amos declared, among other things, that “the fact of the matter is, 80 percent of (allegations) are legitimate sexual assault” rather than “buyer’s remorse.” Amos further pronounced himself “very, very disappointed” in court-martial panels that have become “so soft” and were unwilling to “get rid” of bad apples.

“A disinterested observer, knowing that potential court-martial members heard this very personal appeal in April from the (commandant) to ‘fix’ the sexual assault problem, would harbor significant doubts about the fairness of a sexual assault trial held shortly thereafter in June,” Chief Judge Moira Modzelewski, a Navy captain, wrote for the court.

A concurring judge, Lt. Col. R. Quincy Ward, noted, however, that the court was only finding the appearance of unlawful command influence, rather than actual command influence.

Howell had been charged with rape, forcible sodomy, assault and adultery. He maintained that any sexual contact, with the mother of a potential recruit, was consensual. This was effectively the buyer’s remorse defense that Amos had explicitly dismissed as invalid; or, as the Marine general put it, “bull — — .”

Howell’s 2012 court-martial trial at Parris Island, S.C., became further complicated when the original trial judge, Lt. Col. Robert G. Palmer, delivered his own denunciations of alleged perpetrators while speaking in June 2012 to younger lawyers.

“Palmer made the following comments: ‘The defendant is guilty. We wouldn’t be at this stage if he wasn’t guilty. It is your job to prove he is guilty. You need to take him down,’” Modzelewski recounted.

Palmer’s exhortations came after he had rejected defense requests to find the commandant’s remarks amounted to the appearance of unlawful command influence.

Defense attorneys subsequently complained, and Palmer stepped down from the bench for another assignment. Most recently, the Marine Corps has assigned him to serve as the regional defense counsel for the East Coast, covering bases in North Carolina and South Carolina.

Palmer is slated to start this new job by the end of May. A Marine Corps spokesman said he is unavailable to comment.

Other judges completed Howell’s trial, at which he was eventually found guilty of all charges and sentenced to 18 years in prison. Although these judges took steps to address defense complaints about unlawful command influence, the appellate court reasoned they weren’t sufficient.

“An objective member of the public would be left with the appearance and the impression that Lt. Col. Palmer’s flawed rulings, both on the (unlawful command influence) motion and on defense challenges, infected the verdict and sentence,” Modzelewski concluded.

Massey, who is based in Erlanger, Ky., said Howell will be released from the U.S. Disciplinary Barracks at Leavenworth. Howell has been incarcerated at the military prison in Kansas for the past 1 1/2 years. He also will be restored to his rank of staff sergeant, Massey said.

Potentially, the Marine Corps could decide to put Howell on trial again, as the appellate court reasoned that “allowing a retrial does not unfairly advantage the government.” A decision to seek another trial, or perhaps negotiate severance from the service, was not immediately forthcoming.

“The Marine Corps respects all decisions of the U.S. Navy-Marine Corps Court of Criminal Appeals and retains full confidence in its military justice system,” Marine Capt. Ty Balzer said late Thursday afternoon.