A US judge on Tuesday accepted a plea of not guilty due to insanity from James Holmes, accused of killing 12 people and wounding dozens in a Colorado theater shooting last year.
Judge Carlos Samour agreed to the plea after reading out a list of conditions, including that the 25-year-old agree to undergo a court-ordered examination to determine if he is mentally competent.
The judge said he wants the tests to be completed by early August when a new hearing will be held, with a view to keeping to a trial date of February next year. "I am going to be aggressive for keeping the trial date," Samour said.
Holmes is accused of wounding another 70 people when he allegedly opened fire last July in a packed midnight screening of the Batman movie "The Dark Knight Rises" in the Colorado town of Aurora, outside Denver.
The trial judge initially entered a straight "not guilty" plea on Holmes's behalf in March. Last month, Holmes tendered an insanity plea, but the judge said he would not yet formally accept it.
In court on Tuesday, the judge read out a five-page, 18-point advisement which defined the applicable test for insanity, and listed what was required of Holmes and his lawyers.
After reading the advisement, the judge asked Holmes if he had any questions, and the accused replied: "No."
The judge ordered Holmes to be sent to the Colorado State Mental Institute in Pueblo, Colorado. He will likely be moved there from jail in a matter of weeks, and could stay there for a month or two.
Witnesses said Holmes threw smoke bomb-type devices before opening fire in the theater with weapons including an AR-15 military-style rifle, a 12-gauge shotgun and a .40-caliber pistol.
Prosecutors are pursuing the death penalty in the case, in which Holmes faces 166 counts of capital murder and attempted murder.
The judge also ruled Tuesday that a package sent by Holmes to a college psychiatrist who had been treating him, reported to contain a notebook which could include plans for the attack, could be turned over to prosecutors.
The package was addressed to Dr. Lynne Fenton and arrived at a University of Colorado Medical School mailing room three days after the attack. She has never seen it, and it has been held by a court clerk since last summer.
It will be turned over to prosecutors on Monday. They can then give it to the psychiatrist who examines Holmes, who will also be able to review nearly 50,000 pages of evidence and statements gathered during the investigation.
Separately, Holmes' attorneys filed 89 motions relating to issues including letting Holmes appear in regular clothes rather than jail uniforms during trial, and having the case tried further away from Aurora.
The case has been delayed in recent months amid legal wrangling. In late March, defense lawyers filed an unexpected motion offering that Holmes would plead guilty in return for the prosecution not pressing for the death penalty.
Prosecutors shot back within 24 hours, accusing the defense of trying to negotiate a plea deal in public, in violation of a gag order.
Colorado currently has three convicted prisoners on death row but has not executed anyone since 1997.
State governor John Hickenlooper recently sparked protests when he postponed indefinitely the execution of Nathan Dunlap, who was set to die in August for killing four people at a Chuck E Cheese restaurant in Aurora in 1993.
A new hearing in the Holmes case is scheduled for August 2, to assess the psychiatric review.