DENVER (AP) — A high school student charged in a classmate's death during a Colorado school shooting told police that he planned the attack for weeks and intended to target classmates who repeatedly mocked his gender identity.

Written summaries of police interviews with the two suspected shooters portray 16-year-old Alec McKinney as the leader of the attack, enlisting 18-year-old Devon Erickson in the plan to kill the students who bullied McKinney, who identifies as male.

Both teenagers told police that they broke into a gun safe at one of the teenager's homes before walking into the STEM School Highlands Ranch on the afternoon of May 7 with a guitar case and a backpack concealing four guns.

McKinney "said he wanted the kids at the school to experience bad things, have to suffer from trauma like he had had to in his life," the document said. "He wanted everyone in that school to suffer and realize that the world is a bad place."

Both teenagers are charged with murder and attempted murder in the shooting.

Prosecutors charged McKinney as an adult; his attorneys have said they plan to ask a judge to move the case back to juvenile court. Neither has entered a plea yet, and their attorneys opposed the unsealing of records associated with the criminal cases.

The document also revealed that a hired school security guard responding to the gunfire accidentally shot a female student. According to the record, several officers reported that the guard fired twice at a Douglas County Sheriff's lieutenant.

The guard said he saw "a muzzle" come around a corner. The record said one of the guard's shots wounded a female student inside a classroom.

The document also said the guard caught one of the suspected shooters in a hallway.

Robert Burk, attorney for the unnamed guard, said Thursday that he had not seen the document and could not comment.

A judge sealed both court records after Erickson and McKinney made their initial court appearances, preventing police or prosecutors from discussing almost anything about the case.

The document released Thursday provides the clearest timeline of the attack.

During a police interview, Erickson told police that McKinney sent him a Snapchat message on the night of May 6 telling him not to go to school the next day because McKinney wanted to get revenge "on a lot of people." McKinney identifies as male and told police that classmates called him "disgusting," made fun of him and repeatedly referred to him "as a she."

On May 7, they left school and went to Erickson's house during lunch. McKinney told police he threatened Erickson with an ax to get him to help open a gun safe using the ax and a crowbar.

They told police they found four weapons inside — three handguns and a rifle. After loading the guns, they put the weapons inside a guitar case and a backpack. Erickson said they both used cocaine while at the house.

They drove back to the school and walked through the middle school entrance where McKinney "knew they would not be checked," according to the report.

They targeted classroom 107 and Erickson told police he entered alone first, dropping off the guitar case. Erickson said he left the room briefly and intended to tell an adult but found McKinney waiting for him.

They went back to the classroom and entered through separate doors.

Their accounts of what happened inside the room differ.

Erickson said he saw McKinney reach for a gun then decided to shout for everyone to get down. Erickson said he saw two students rush toward him and said their impact "prompted the gun to go off."

"While he was on the ground, he heard more gunshots and yelling and screaming," the record said. "Devon described being in shock and stated he didn't want anyone to get shot."

McKinney told police they entered the room simultaneously, yelling "nobody move," and he fired after hearing Erickson shoot.

McKinney "said he shot the revolver until it was empty and then shot the Glock until it was empty" before being tackled by students and a teacher. McKinney said he escaped and ran, intending to kill himself with the remaining weapon but surrendered to an armed security guard in the hallway.

The document, which blacked out all students' names, says at least 29 people were in the room at the time of the shooting. Three students have previously been credited with tackling one of the shooters, including 18-year-old Kendrick Castillo, who was killed.

Erickson portrayed McKinney as a mastermind and told police repeatedly that he wanted to stop his friend. Police wrote in the document that Erickson "couldn't articulate how or why he never told an adult."

McKinney suggested that Erickson became an active participant by loading the guns, locking the door of the classroom they targeted and firing the first shot, according to the record.

Prosecutors filed the same charges against both teenagers.