WASHINGTON — When President Barack Obama proclaimed that those who commit sexual assault in the military should be “prosecuted, stripped of their positions, court-martialed, fired, dishonorably discharged,” it had an effect he did not intend: roiling legal cases across the country.

In at least a dozen sexual assault cases since the president’s remarks at the White House in May, judges and defense lawyers have said Obama’s words as commander in chief amounted to “unlawful command influence,” tainting trials as a result. Military law experts said those cases were only the beginning and that the president’s remarks were certain to complicate almost all continuing prosecutions for sexual assault.

“Unlawful command influence” refers to actions of commanders that could be interpreted by jurors as an attempt to influence a court-martial, in effect ordering a specific outcome. Obama, as commander in chief of the armed forces, is considered the most powerful person to wield such influence. The president’s remarks might have seemed innocuous to civilians, but military law experts say that defense lawyers will seize on the president’s call for an automatic dishonorable discharge, the most severe discharge available in a court-martial, arguing that his words will affect their cases.

“His remarks were more specific than I’ve ever heard a commander in chief get,” said Thomas J. Romig, the former judge advocate general of the U.S. Army and the dean of the Washburn University School of Law in Topeka, Kan. “When the commander in chief says they will be dishonorably discharged, that’s a pretty specific message. Every military defense council will make a motion about this.”

At Shaw Air Force Base in South Carolina last month, a judge dismissed charges of sexual misconduct against an Army officer because of the president’s remarks. At Fort Bragg in North Carolina last month, lawyers cited the president’s words in a motion to dismiss the court-martial against Brig. Gen. Jeffrey Sinclair, who is accused of forcing a lower-ranking officer to perform oral sex on him, among other charges.

In Hawaii, a Navy judge ruled last month that two defendants in sexual assault cases, if found guilty, could not be punitively discharged because of Obama’s remarks. In Texas, a juror was dismissed from a military panel on a sexual assault case after admitting knowledge of the president’s words.

In Alexandria, Va., Eric S. Montalvo, a former defense counsel in the Marine Corps who is now in private practice specializing in military law, has cited the president’s words in motions to dismiss two sexual assault cases, one against an Army sergeant and the other against a Navy seaman.

“Because the president is the commander in chief, it’s going to come up in basically every imaginable context in sexual assault cases,” said Eugene R. Fidell, who teaches military justice at Yale Law School.

Obama’s comments come at a time of intense scrutiny of sexual assault in the military. A recent Pentagon survey found that an estimated 26,000 men and women in the military were sexually assaulted last year, up from 19,000 in 2010. At the end of the last fiscal year — Sept. 30 — there were roughly 1,600 continuing sexual assault cases in the military either awaiting action from commanders or the completion of a criminal investigation.

White House officials said Obama’s remarks, made in response to a reporter’s question, were meant to demonstrate his concern about the issue and were not intended to recommend penalties for offenders.

“The president was absolutely not trying to be prescriptive,” said Kathryn Ruemmler, the White House counsel. “He was listing a range of examples of how offenders could be held accountable. The president expects all military personnel who are involved in any way in the military justice process to exercise their independent professional judgment.”

Some military law experts said that while defense lawyers would naturally use the president’s words to try to get cases dismissed, they would be pushing legal boundaries. Obama, they said, used the phrase “dishonorable discharge” as a catchall for getting assailants out of the military and not in its strict, technical meaning.

“There is a point at which the statements of civilian officials could be so specifically directed, or so inflammatory, that a military defendant is deprived of due process,” said Diane H. Mazur, a professor emeritus at the University of Florida Levin College of Law. “But I don’t think the president’s remarks come close to that level.”

But others said it was hard not to see the potent meaning in Obama’s remarks, particularly on Capitol Hill, where lawmakers are contemplating making dishonorable discharge an automatic punishment for convicted offenders.

“There is a tension created between trying to give the victim their day in court, but you can’t ignore the defendant’s rights,” said Victor M. Hansen, a former military lawyer who is now an associate dean at the New England School of Law in Boston. “Whatever efforts are made to better address sexual assault, there is always the other side of the equation if someone gets too out front of the issue.”

The president’s comments have not been the only ones cited as influencing sexual assault cases. Last year, lawyers in more than 60 Marine Corps sexual assault cases filed motions claiming “unlawful command influence” because of a series of remarks made by Gen. James F. Amos, the commandant of the Marine Corps, according to a McClatchy-Tribune news report.

Lawyers said it was too soon to know how many judges would grant motions for dismissal because of Obama’s words. They said that in many cases, judges might stop short of that and rule that defendants should stand trial but not be punitively discharged — as Navy Judge Cmdr. Marcus Fulton did in the Hawaii case. (The prosecution is appealing the ruling.) Lawyers said that some judges might simply instruct jurors to disregard the president’s remarks.

But at Shaw Air Force Base, the judge dismissed the case last month against the Army officer based on a motion filed by the officer’s defense lawyer, Scott M. Somerset. In a military built on obeying the orders of commanders immediately and without question, Somerset made this argument in his motion: “The president publicly stated that a particular court-martial punishment is the correct response to the crime of sexual assault.” He further argued, “What choice would that seem to give” a judge “if the commander in chief is telling him to dishonorably discharge anybody who has engaged in sexual assault?”

In Hawaii, Fulton wrote that Obama’s comments raised “concern” because “they may indicate that a particular result is required of the military justice system.”

In his comments on sexual assault, Obama said, “I expect consequences.” He added: “So I don’t just want more speeches or awareness programs or training, but ultimately, folks look the other way. If we find out that somebody’s engaging in this, they’ve got to be held accountable.”