DENVER (Reuters) - The man charged with mass murder for a shooting rampage that killed 12 people in a suburban Denver movie theater must submit to a second pretrial sanity examination because the first was incomplete and inadequate, a Colorado judge ruled on Wednesday.

The second court-ordered exam will focus on James Holmes' state of mind at the time of the killings, not on his competency to stand trial, and on whether any mental illness precludes him from facing the death penalty if convicted.

Holmes, 26, a former graduate student of neuroscience, had been slated to go on trial this month for the July 2012 massacre of moviegoers during a midnight screening of the Batman film "The Dark Knight Rises."

But Arapahoe County District Court Judge Carlos Samour ruled in November that the trial be postponed indefinitely to deal with requests by prosecutors for further mental evaluations of the defendant.

Holmes underwent an extensive psychological examination at a state mental hospital last year after pleading not guilty by reason of insanity, meaning that prosecutors have the burden of showing he knew right from wrong at the time of the shooting.

Defense attorneys have acknowledged in previous court filings that Holmes committed the shooting frenzy but say he was in the midst of a "psychotic episode" at the time. They say he has been hospitalized for mental health issues at least twice since his arrest on the day of the shooting.

It was disclosed in court in December that the first sanity exam concluded Holmes was mentally fit, or competent, to stand trial, meaning he was deemed capable of understanding the proceedings and assisting in his own defense.

The original exam's finding as to his sanity at the time of the massacre has not been publicly revealed, but prosecutors are presumed to have disagreed with those conclusions in asking for a second review.

Indeed, Samour directed that the new exam re-evaluate the sanity question when he agreed with prosecutors that the first examination was "incomplete and inadequate."

Holmes is charged with multiple counts of first-degree murder and attempted murder for opening fire during the crowded midnight screening in Aurora, Colorado, in one of the deadliest outbursts of gun violence by a lone gunman in U.S. history.

(Reporting by Keith Coffman; Editing by Steve Gorman, Bernard Orr)

[Image via Agence France-Presse]