The former University of Colorado graduate student accused of killing 12 people and wounding 58 others in a shooting rampage at a cinema last week had been under the care of a psychiatrist who was part of a campus threat-assessment team.

The disclosure came in court documents filed yesterday by lawyers for James Holmes, 24, who is accused of opening fire last Friday on a packed showing of the latest Batman movie, "The Dark Knight Rises," in the Denver suburb of Aurora.

The defence attorneys, in their request to an Arapahoe County district judge, are seeking a court order requiring prosecutors to turn over the contents of a package that Holmes sent to Dr. Lynne Fenton and was later seized by investigators.

"Mr. Holmes was a psychiatric patient of Dr. Fenton, and his communications with her are protected," the filing said.

Fenton, medical director for student mental health services at the University of Colorado-Denver Anschutz Medical Campus, provides medication and psychotherapy for grad students in addition to her teaching duties, according to a school website.

A professional biography of Fenton posted on the site said she had conducted research on schizophrenia, including a two-year grant to work in the schizophrenia research department of the US Department of Veterans Affairs from 2008 to 2010.

Fenton also is a member of the campus-based "behavioral assessment and threat assessment team," which helps faculty and staff deal with "individuals who may be threatening, disruptive or otherwise problematic," according to that group's website.

It could not be ascertained if Fenton was caring for Holmes under the threat-assessment program or under routine counseling she provided to students on campus.

Under Colorado law, mental health professionals cannot be held liable in civil suits for failing to predict a patient's violent behavior unless it involves a "serious threat of imminent physical violence against a specific person or persons." When such a threat is made, the mental health professional is required to take action, which may include notifying those targeted or a law enforcement agency.

Fenton could not immediately be reached for comment, and a spokeswoman for the University of Colorado medical school declined to comment, citing restrictions under a gag order issued by the judge presiding over the case.

The university, where Holmes had been enrolled as a doctoral student of neuroscience, confirmed earlier this week that a suspicious package was delivered by mail on Monday and that it was "immediately investigated and handed over to authorities within hours."

Fox News has reported, citing an unnamed law enforcement source close to the investigation, that two packages were sent by Holmes to a psychiatrist on the faculty of the University of Colorado, and that one contained a notebook detailing the shooting scenario. According to Fox News, the notebook contained hand-drawn illustrations of stick figures shooting at other stick figures.

The defence motion accuses the government of leaking information to the media in defiance of a gag order, thereby jeopardizing Holmes' rights to due process and fair trial by an impartial jury. It says his lawyers will request a hearing to determine "appropriate sanctions for this misconduct."

Prosecutors, responding to the discovery motion, disputed various elements of media accounts as being erroneous, suggesting that anyone who had provided information to Fox News and other outlets lacked real knowledge of the case.

"These factual errors lead (the government) to believe ... that the media is getting information from hoaxers, fraudsters, or maybe from nobody at all by creating fake 'law enforcement sources' out of whole cloth," prosecutors said in their filing.

Formal charges against the suspect, who dyed his hair bright orange and was said by authorities to have referred to himself as the Joker - Batman's comic book archenemy - are expected to be filed in court on Monday.

The judge in the case, William Sylvester, set a hearing on the defence discovery motion to be held as part of Monday's proceedings. Sylvester also said he would consider a pleading by news media organizations to make public court documents the judge has sealed in the case.

Arrested within minutes of the shooting rampage at his car in the theatre's parking lot, Holmes is being held in solitary confinement in the local jail.

In addition to charges stemming from one of the worst outbursts of US gun violence in recent years, he is accused of wiring his apartment with enough explosives to have leveled the entire building if they had been detonated.

The apartment house was evacuated when the booby traps were discovered. But the explosives were later safely dismantled and removed by authorities, and Holmes' neighbors began returning to their homes on Wednesday night.

The latest disclosures about the suspect came to light as mourners attended the third funeral in as many days for one of the victims of the shooting rampage, this one for an 18-year-old high school graduate, Alexander J. "AJ" Boik," who was bound for art college in the fall.

In addition to Fenton's research on schizophrenia, she also has a background in physical medicine and had worked as a medical acupuncturist at a Colorado rehab centre for several years before doing her residency in psychiatry, according to her resume on the University of Colorado website.

State records posted online show that she received a "letter of admonition" from the Colorado Board of Medical Examiners in 2004, though details of the rebuke could not be immediately accessed from the board's website.

The New York Times reported the admonition cited Fenton for prescribing various pills for her husband and other non-patients on several occasions - including the sleep aid Ambien, the allergy medication Claritin and the painkiller Vicodin - and for failing to properly document the prescriptions. According to the Times, the board noted in its letter that she was no longer writing prescriptions for non-patients.