Prosecutor: Accused Aurora Shooter James Holmes Made Death Threat in March

VIDEO: Colorado shooting suspect faces 142 criminal
WATCH James Holmes Charged With 24 Counts of Murder

Suspected Colorado shooter James Holmes allegedly told a classmate in March 2012 that he wanted to kill people and "that he would do so when his life was over," according to a court document filed by prosecutors that was unsealed today.

The document was filed after Holmes' defense team tried to quash prosecutors' request for his educational records. Prosecutors argued that the documents are relevant to the investigation of the crime.

"The defendant had conversations with a classmate about wanting to kill people in March 2012, and that he would do so when his life was over," district attorney Carol Chambers wrote.

The 24-year-old Ph.D. student is accused of a mass killing in which he sprayed three weapons' full of ammunition into a crowded movie theater during a midnight premiere screening of the Batman movie, "The Dark Knight Rises," on July 20. Twelve people were killed and 58 were wounded in the worst mass shooting in U.S. history, as measured by number of people shot.

Holmes was charged with 24 counts of first degree murder, two counts for each of the people he is accused of killing. He was also charged with 116 counts of attempted first degree murder, one count of possessing an explosive device and one count of violent crime. He faces a total of 142 criminal charges.

Holmes failed his graduate school oral exams in June 2012 and was denied access to the school "after he made threats to a professor at the school," Chambers wrote. Holmes began buying his guns at the end of May.

He subsequently began the process to "voluntarily withdraw" from his program and was in the process of completing that withdrawl when the shooting occurred, the document said.

"After he was denied access to the CU-Denver Anschutz campus he began a detailed and complex plan to obtain firearms, ammunition, a tear-gas grenade, body armor, a gas-mask, and a ballistic helmet, which were used in the commission of the murders and the attempted murder," the prosecutor wrote.

In a Thursday court appearance, prosecutors went before a Colorado judge to make their case for why they should have access to Holmes' school records.

"What's going on in the defendant's life at the time is extremely relevant to this case," Chief Deputy District Attorney Karen Pearson said, according to the Associated Press.

Pearson revealed a possible motive in court, saying that Holmes was upset about failing school and, "at the same time he's buying an enormous amount of ammunition, body armor and explosives," according to the AP.

The judge has not yet decided if he will allow the school records to be used as evidence. A gag order had been placed on all parties in the case to prevent them from discussing any details of the case.

Attorneys are also waiting for the court to decide whether the contents of a package Holmes mailed to his Lynne Fenton, his psychiatrist at the University of Colorado, can be used as evidence. Fenton is expected to testify at Holmes' next court date, scheduled for Aug. 30.

ABC News' Lauren Pearle contributed to this report