The suspect in the deadly Colorado cinema attack threatened a professor and was banned from his university campus before one of the worst mass shootings in US history, prosecutors have said.
Newly released court documents gave an important look at a case whose details have been kept largely out of public view.
James Holmes faces 152 charges over the July shooting at a midnight premiere of the latest Batman film that killed 12 people and injured five. His lawyers argue he is mentally ill.
The documents say the threat is why the University of Colorado revoked Holmes' access to campus. The name of the professor has been blacked out. Prosecutors say the professor reported the threats to the university, and Holmes was denied access to campus "as a result of these actions".
In other documents, defence lawyers say the prosecutors' allegations are false, based on university statements. The university has said Holmes was denied access to non-public parts of the campus because he had withdrawn from school.
Defence lawyers said Holmes sought the help of a university psychiatrist before the shooting, raising the possibility that Holmes will plead not guilty by reason of insanity.
In court, prosecutors raised the prospect that Holmes was angry at the failure of a once-promising academic career and stockpiled weapons, ammunition, tear gas grenades and body armour as his research deteriorated and professors urged him to get into another profession. After the shooting, Holmes' apartment was found rigged with explosives.
Chief Deputy District Attorney Karen Pearson said Holmes failed a key oral exam in June, was banned from campus and began to voluntarily withdraw from the school.
Court documents have confirmed that Holmes sent a package to university psychiatrist Lynne Fenton. Defence lawyers describe Ms Fenton as Holmes' psychiatrist, although prosecutors have said their doctor-patient relationship ended on June 11, weeks before the attack.
Court documents also confirm information from prosecutors that Holmes in March spoke with another student about killing people "when his life was over".