DENVER (Reuters) - Prosecutors in the case against accused movie theater gunman James Holmes can see his college records that could shed light on the former graduate student's intent and motive, a judge ruled on Wednesday.

Lawyers defending Holmes sought to prevent prosecutors from viewing his records at the University of Colorado, arguing that the request was "a fishing expedition."

Holmes, 24, is accused of killing 12 people and wounding 58 others during a screening of "The Dark Knight Rises" at an Aurora, Colorado, movie theater on July 20.

Prosecutors have said Holmes failed his oral examinations at the university in March, and was told by a faculty member that perhaps he was not a good fit for the competitive neuroscience PhD program.

Holmes then began a voluntary withdrawal from the school and amassed an arsenal of weapons as part of "a detailed and complex" plan to commit mass murder, prosecutors charge in court filings.

While noting the defense's argument that motive is not a required element to prove guilt, Arapahoe County District Court Judge William Sylvester ruled that the documents could reveal Holmes' state of mind leading up to the rampage.

"Intent will be a key issue at trial, and it is likely that facts relevant to prove motive will tend to make the issue of intent more or less probable," Sylvester wrote.

He also ordered that any files kept by the university's campus police on Holmes should be turned over to the government.

Defense lawyers have said in court that Holmes suffers from an unspecified mental illness. Legal analysts see this as an attempt to set up a not-guilty-by-reason-of-insanity defense.

Holmes has yet to enter a plea, and prosecutors have not indicated whether they will seek the death penalty.