DENVER — A star witness for the defense in James E. Holmes’s murder trial testified this week that Mr. Holmes was schizophrenic and legally insane in July 2012, when he opened fire in a crowded movie theater in the neighboring suburb of Aurora, killing 12 people and injuring 70.

The witness, Dr. Raquel Gur, was one of four psychiatrists who examined Mr. Holmes after the shootings, and her observations bolstered the defense’s position that while Mr. Holmes was indeed the gunman, he met the legal standard for insanity at the time.

Dr. Gur, who began her testimony on Monday, explained that she had questioned Mr. Holmes for 28 hours over six days, starting in late 2012. “The severity and intensity of his psychosis,” she said on Tuesday, “was so high, so severe, as to render him incapable of distinguishing between right and wrong.”

It was crucial testimony in a trial that started on April 27 in the Arapahoe County courthouse in Centennial, Colo., a Denver suburb, and that could go to the jury next week. If jurors find Mr. Holmes insane, the state will send him to a psychiatric hospital. If they deem him sane, the trial will proceed to a sentencing phase, and he could face the death penalty.