A judge has allowed James Holmes to enter a plea of not guilty by reason of insanity in the Colorado theatre shootings.

Tuesday's decision in Centennial, Colo., south of Denver, sets the stage for a lengthy mental evaluation of Holmes, who is accused of fatally shooting 12 people and injuring 70 in a packed Denver-area movie theatre in July at a screening of The Dark Knight Rises.

The evaluation could take months. Holmes is charged with multiple counts of murder and attempted murder. Prosecutors are seeking the death penalty.

Holmes' lawyers repeatedly have said he is mentally ill, but they delayed the insanity plea while arguing that state laws were unconstitutional. They said the laws could hobble the defence if Holmes's case should ever reach the phase where the jury decides if he should be executed.

The judge rejected that argument last week.

With files from Reuters