Reuters Colorado shooting suspect James Eagan Holmes makes his first court appearance in Aurora, Colorado on July 23.

The suspect in a deadly movie theater attack in Colorado threatened a professor before the shooting, leading the university to ban him from campus, prosecutors said in court documents released Friday.

The name of the person James Eagan Holmes threatened has been blacked out. Prosecutors say the person reported the threats, and Holmes was denied access to campus "as a result of these actions."

In other documents, defense attorneys say the prosecutor's allegations are false, based on university statements.

The University of Colorado has said Holmes was denied access to non-public parts of the campus because he had withdrawn from school.

Holmes, 24, faces 152 charges in the July 20 shooting at an Aurora movie theater during a midnight showing of the new Batman movie, "The Dark Knight Rises." The attack killed 12 people and injured 58 others. After the shootings, police went to Holmes' apartment which was wired with a complex system of tripwires and explosive devices.

Defense attorneys claim Holmes is mentally ill, raising the possibility that Holmes will plead not guilty by reason of insanity.

In court, prosecutors have 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 armor as his research deteriorated and professors urged him to get into another profession.

After weeks of secrecy surrounding the case, most of the documents filed in court were released to the public on Friday.

In his order, Judge William Sylvester said that the release, with some restrictions, and considerable redaction, balances the public's First Amendment rights to see the court file, and attorneys' concerns. Prosecutors and defense attorneys had asked that court documents be sealed to preserve an ongoing investigation and protect Holmes' right to a fair trial.

Sylvester ordered that some information in the documents released Friday have information blacked out to protect the identities of witnesses. Documents that won't be released include an arrest affidavit, which contains information about the investigation, as well as requests for search warrants and subpoenas.

Many of the newly released documents unveil the legal struggle over the relationship between Holmes and a psychiatrist. The defense has argued that the relationship is privileged and that the evidence should not information that may have passed between the doctor about Holmes. Prosecutors have downplayed the formality of the relationship which they say ended well before the July 20 attack.

See all available documents on the case

The newly released documents, though heavily redacted, suggest that prosecutors believe the doctor had knowledge that Holmes posed a threat.

"The statutes of the General Assembly, and those of Congress, and the Constitution of the United States, are designed to protect life, liberty and the pursuit of happiness for everyone. They cannot be construed as to prevent [redacted]from sharing with appropriate individuals’ information necessary to secure the safety — or even the life — of the [redacted]. They cannot be construed to allow an individual to make threats against the safety of the community and at the same time, prohibit the recipient of such threats from acting on them. [Redacted portion.]“[W]hile the Constitution protects against invasions of individual rights, it is not a suicide pact."

Previous court documents confirmed that Holmes sent a package to the University of Colorado psychiatrist, Lynne Fenton.

The package contains a notebook that reportedly includes descriptions and drawings of an attack, but Fenton said she never saw the notebook, which was sitting in an unopened package in a university mail room when authorities obtained it.

Watch the most-viewed videos on NBCNews.com

The newly released documents also reveal that investigators have gleaned information from a witness described as a colleague of Holmes at the University of Colorado. The witness was interviewed by police, and also gave police access to text messages he received from Holmes.

According to the document, which explained redaction of the records, forensics experts said they could not isolate the text messages from the rest of the content on the phone, so they downloaded all of it — 2,275 pages of personal contacts, photographs, and personal conversations with the witness's therapist — and then redacted all but a handful of text messages from Holmes.

NBC News' Kari Huus and The Associated Press contributed to this report.

More content from NBCNews.com:

Follow US News from NBCNews.com on Twitter and Facebook

Follow Kari Huus on Facebook