A psychiatrist who treated the suspect in last year's Colorado cinema shooting told police a month before the attack that James Holmes had homicidal thoughts and was a danger to the public, newly released documents show.
The attack killed 12 and injured 70 and was one of the worst mass shootings in US history.
The documents released on Thursday show Dr Lynne Fenton told police at the University of Colorado, Denver, that Holmes also threatened and intimidated her.
Holmes last week offered to plead guilty over the shooting, which occurred during a midnight premiere of the latest Batman movie. Prosecutors rejected that offer and said on Monday they would seek the death penalty.
The documents had been sealed, but a new judge overseeing the case ordered them released after requests from media organisations.
In the days after the shooting, campus police said they had never had contact with Holmes, a graduate student at the university. But campus police told investigators that Dr Fenton had contacted them, following her legal requirement to report specific threats to authorities, according to a search warrant affidavit.
"Dr Fenton advised that through her contact with James Holmes she was reporting, per her requirement, his danger to the public due to homicidal statements he had made," the affidavit said. University police referred calls for comment on Thursday to a campus spokeswoman who did not immediately return a message.
Holmes also sent Dr Fenton a package in the days before the shooting, including a notebook that the documents describe as a "journal". The package was not discovered until four days after the attack.
Prosecutors have suggested 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. 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.
Both prosecutors and defence lawyers had raised concerns about releasing the documents. Prosecutors said they were worried about the privacy of victims and witnesses. Lawyers for Holmes said they did not want to hurt his chances for a fair trial. Media organisations said there has been a "wealth of information already made public in the proceedings thus far". They argued there was no basis for the documents to remain sealed.