CENTENNIAL, Colo. — A psychiatrist who treated James Holmes told campus police a month before the Colorado theater attack that Holmes had homicidal thoughts and was a danger to the public, according to documents released Thursday.

Dr. Lynne Fenton, a psychiatrist at the University of Colorado, Denver, told police in June that the shooting suspect also threatened and intimidated her. It was more than a month before the July 20 attack at a movie theater that killed 12 and injured 70.

In the days after the attack, campus police said they had never had contact with Holmes, who was a graduate student at the university.

But campus police Officer Lynn Whitten told investigators after the shooting that Fenton had contacted her. Whitten said Fenton was following her legal requirement to report threats to authorities, according to a search-warrant affidavit.

Whitten added that Fenton said she began to receive threatening text messages from Holmes after he stopped seeing her for counseling, the documents said.

Whitten did not respond to messages left at her home and office. University spokeswoman Jacque Montgomery said she could not comment.

The documents previously were sealed, but the new judge overseeing the case ordered them released Thursday after requests from media organizations, including The Associated Press.

The records show that police collected more than 100 items of evidence from Holmes’ Aurora apartment, including more than 50 cans and bottles of beer, a Batman mask, paper shooting targets and medication to treat depression and anxiety.

Holmes last week offered to plead guilty in the attacks. Prosecutors rejected that offer and said they would seek the death penalty.

The document that includes the information on the psychiatrist was filed to obtain the contents of a package Holmes sent to her before the attack.

The package was dated July 12 — eight days before the massacre — but was found four days after the attack, in the university mail room.

The newly released records describe Holmes’ behavior after police found him, still clad in ballistic gear, leaving the theater after the massacre. Among other things, he warned detectives that he had booby-trapped his apartment.

District Judge Carlos Samour took over the case this week after Judge William Sylvester handed it off, saying prosecutors’ decision to seek the death penalty meant the case would take up too much of his time. Sylvester has administrative duties as chief judge of a busy four-county district.

In other gun-related developments Thursday:

• Connecticut Gov. Dannel Malloy signed into law new restrictions on assault weapons and large-capacity ammunition magazines in response to the Sandy Hook Elementary School massacre.

• Maryland’s gun laws will become among the strictest in the nation with a measure passed by the General Assembly. The measure would require people who buy a handgun to submit fingerprints to State Police, ban 45 types of assault weapons, and limit gun magazines to 10 bullets. Gov. Martin O’Malley said he will sign it.