Updated at 2:05 p.m. ET
CENTENNIAL, Colo. A judge on Tuesday accepted James Holmes' plea of not guilty by reason of insanity, setting the stage for a lengthy mental evaluation of the Colorado theater shooting suspect.
Judge Carlos Samour Jr. also determined prosecutors can have access to a notebook that Holmes sent to a psychiatrist before last summer's rampage.
Lawyers argued briefly in court about whether prosecutors should have access to a notebook Holmes sent to psychiatrist Lynne Fenton. Media reports have said the notebook contains drawings depicting violence.
Defense lawyers argued Fenton never received the notebook so prosecutors shouldn't have access to it.
Prosecutors say police would like to do unspecified "additional processing" on the notebook. Samour ordered the notebook to be turned over next week.
The court clerk placed a written advisory of the ground rules of the plea before Holmes so he could follow it as Samour read through all 18 points.
When Samour asked if he had any questions, Holmes answered "no" in a clear, firm voice. Samour then accepted the plea.
"I find Mr. Holmes understands the effects and consequences of the not guilty by reason of insanity plea," the judge said. "He was looking at the advisement and appeared to be following along."
Holmes is accused of opening fire in a packed Denver-area movie theater last summer, killing 12 people and injuring 70. He is charged with multiple counts of murder and attempted murder, and prosecutors are seeking the death penalty.
Holmes' lawyers repeatedly have said he is mentally ill, but they delayed the insanity plea while arguing state laws were unconstitutional. They said the laws could hobble the defense if Holmes' case should ever reach the phase where the jury decides if he should be executed.
The judge rejected that argument last week.
On Tuesday, Samour ordered Holmes to undergo a mental evaluation at the state hospital in Pueblo, as soon as the hospital is ready to conduct it. Evaluators want to review the 40,000 pages of evidence in the case first, so it's unclear when it will happen. Samour set a tentative deadline of Aug. 2 for Holmes' evaluation but indicated he would grant more time if doctors want it.
The hearing came as the court released dozens of pretrial motions filed by defense attorneys challenging the admissibility of ballistics, handwriting and mountains of other evidence, and signaling Holmes will seek a change of venue because of pretrial publicity.
The motions challenge the search and seizure of computers, a pistol from Holmes' car outside the theater, evidence taken from Holmes' booby-trapped apartment, emails and other items. The motions also indicate the prosecution has as many as 3,000 witnesses, including FBI and Aurora officials, and demands that prosecutors hand over as many as 2,000 pieces of physical evidence.
Hundreds of people were watching a midnight showing of "The Dark Knight Rises" at the Aurora theater July 20 when the shooting occurred.
The dead included a Navy veteran who threw himself in front of his friends to shield them, an aspiring sports journalist who had survived a mall shooting just two months earlier, and a 6-year-old girl.
Prosecutors say Holmes spent months buying weapons, ammunition and materials for explosives and scouted the theater in advance. He donned police-style body armor, tossed a gas canister into the seats and opened fire, they say.
The insanity plea is widely seen as Holmes' best chance of avoiding execution, and possibly his only chance, given the weight of the evidence against him.
But his lawyers delayed it for weeks, saying Colorado's laws on the insanity plea and the death penalty could work in combination to violate his constitutional rights.
The laws state that if Holmes does not cooperate with doctors conducting a mandatory mental evaluation, he would lose the right to call expert witnesses to testify about his sanity during the penalty phase of his trial. Defense lawyers argued that is an unconstitutional restriction on his right to build a defense. They also contended the law doesn't define cooperation.
Samour rejected those arguments last week and said the laws are constitutional.
Colorado law defines insanity as the inability to distinguish right from wrong caused by a diseased or defective mind.
If jurors find Holmes not guilty by reason of insanity, he would be committed indefinitely to the state mental hospital. He could eventually be released if doctors find his sanity has been restored, but that is considered unlikely.
If jurors convict him, the next step is the penalty phase, during which both sides call witnesses to testify about factors that could affect why Holmes should or shouldn't be executed.
The jury would then decide whether Holmes should be executed or sentenced to life in prison without possibility of parole.
If jurors impose the death penalty, it would trigger court appeals and open other possibilities that would take years to resolve.