Updated

Colorado theater shooting defendant James Holmes must undergo a second psychiatric evaluation at the state mental hospital because the first was "incomplete and inadequate," the judge ruled Wednesday.

Arapahoe County District Judge Carlos A. Samour Jr. agreed with prosecutors that the first evaluation, conducted last summer, was flawed. Prosecutors are seeking the death penalty, and Holmes' fate likely hangs on whether the jury decides he was sane or insane at the time of the shooting.

If jurors determine Holmes was insane, he would be acquitted and sent indefinitely to the state hospital. But if they decide he was sane, he could be convicted and sentenced either to be executed or spend life in prison without parole.

Prosecutors had asked to have doctors of their choosing conduct the new evaluation, but Samour denied that request, ordering that the second evaluation be conducted by the state hospital, but by a different doctor than last time.

Holmes is charged with killing 12 people and injuring 70 in a 2012 attack on a suburban Denver movie theater. He pleaded not guilty by reason of insanity.

His lawyers have acknowledged he was the shooter but said in a court filing he was "in the throes of a psychotic episode." Colorado law defines insanity as the inability to tell right from wrong.

The verdict on insanity is up to the jury, but the conclusion of the state hospital's evaluation is critical evidence in that decision.

The decision to order another evaluation means another delay in the trial, although how long is uncertain.

Holmes, now 26, is charged with planning and carrying out the assault on 421 people watching a midnight showing of the Batman movie "The Dark Knight Rises" in the Denver suburb of Aurora. He is charged with more than 160 counts of murder and attempted murder.

Police also say he rigged his apartment with potentially deadly bombs to distract first responders.

Holmes had been a promising student in high school and college, and in 2011 he enrolled in a Ph.D. program in neuroscience at the University of Colorado, Denver. But he quit the program a few weeks before the shootings. Prosecutors say he had failed a key test.