Defense lawyers have for the first time admitted that James Holmes shot and killed 12 and wounded 58 others last summer at a midnight showing of a Batman movie in Colorado — but they say he was in the “throes of a psychotic episode” at the time.

Holmes, a 25-year-old former doctoral student in neuroscience, is charged with 166 felony counts of murder, attempted murder and other felonies related to the July 12, 2012, shooting massacre at an Aurora multiplex.

Andy Cross / Pool via Denver Post / AP Aurora theater shooting suspect James Holmes in court in Centennial, Colo., on Tuesday, June 4, 2013.

He pleaded not guilty by reason of insanity last month.

However, a motion filed this week was the first time his attorneys have admitted he committed the shootings.

The Denver Post was the first to report on the motion filed Tuesday and made public on Wednesday.

In arguing that the court should reconsider a ruling that Holmes must wear a restraint under his clothing at trial that is anchored to the floor, defense attorneys admit Holmes was the shooter in the massacre.

“Holmes suffers from a severe mental illness and was in the throes of a psychotic episode when he committed the acts that resulted in the tragic loss of life and injuries," the attorneys wrote.

Defense attorneys were arguing that Holmes had shown good behavior during court proceedings and objected to his being “hitched to the floor like an animal” during his upcoming trial.

Arapahoe County District Judge Carlos Samour, however, rejected the motion saying it wasn’t appropriate for Holmes to be unrestrained at trial because of the multiple violent offenses, and noted that the hidden restraint was the least restrictive available.

On June 25, Samour granted state psychiatrists six additional weeks to examine Holmes — extending a July 31 deadline — to decide whether or not they agreed that Holmes was insane.

Holmes’ trial is scheduled to begin on Feb. 3, 2014 – almost 19 months after the crime.