HIGHLANDS RANCH, Colo. — A private security officer’s bullet wounded a student in the deadly May 7 shooting at STEM School Highlands Ranch, according to an arrest affidavit made public late Thursday afternoon.

That officer is under investigation for reports that he fired on a responding Douglas County sheriff’s lieutenant in the chaos of the incident, 9Wants to Know previously reported.

RELATED: STEM School Highlands Ranch security guard saw muzzle of weapon, fired 2 rounds, sources say

RELATED: Investigators look into report STEM school security officer fired at sheriff's deputy

“One of the shots fired by the security guard wounded a female in room 106,” the affidavit says.

The student was not identified in the seven-page affidavit, which outlines the alleged actions of the two suspects in the case, Devon Erickson, 18, and Alec McKinney, 16.

Each of the suspects has been charged with 46 separate counts, including two counts of first-degree murder, one count of conspiracy to commit first-degree murder, 31 counts of attempted first-degree murder and charges including arson, burglary, theft, weapons possession, criminal mischief, interference with a school and reckless endangerment.

RELATED: September hearing set for suspect in STEM School Highlands Ranch shooting

El Paso County District Attorney Dan May is handling the investigation into the actions of the private security guard, who worked for Boss High Level Protection. Grant Whitus, the owner of the company, told 9Wants to Know he “hadn’t heard” the affidavit outlining the allegations against his employee.

He did not respond to a request for further comment.

One student, Kendrick Castillo, died after he and classmates rushed one of the two gunmen who entered the school at 8773 S. Ridgeline Blvd.

RELATED: Coroner releases autopsy report for STEM School shooting victim Kendrick Castillo

RELATED: 'We need to be more like him': Kendrick Castillo remembered as selfless, tenacious at celebration of life service

The affidavit portrays the attack on the school as being carried out haphazardly with little planning.

According to the affidavit, the younger suspect was “super suicidal” and wanted to get revenge on a lot of people. The older suspect tried to talk him out of it, according to the document, and repeatedly told investigators that he wanted to stop the shooting “but couldn’t articulate how or why he never told an adult.”

The morning of May 7, the two went to the older suspect’s home, investigators wrote in the document. There, according to the affidavit, the two “hung out in the basement” and used cocaine, then broke into a locked gun safe with an ax and a pry bar. They took four weapons – three handguns and a rifle – as well as ammunition and headed to the school, according to the affidavit.

After returning to the school, they smuggled in guns inside a guitar case, according to the affidavit, entering a door where they knew they would not be checked.

RELATED: 'A guitar case with guns made it into the school': DougCo commissioners allocate $10M toward school safety

They went to a classroom and eventually pulled out the guns, yelling “nobody move,” according to the affidavit, then opened fire.

One suspect was tackled by students – including Castillo – and the other was confronted by the security officer who is now under investigation and has been taken into custody.

RELATED: STEM School shooting: Guard was 'instrumental' in taking suspect down

The security officer has not been publicly identified. However, 9Wants to Know has confirmed that he is a 29-year-old former sheriff’s deputy and Marine – and that he apprehended one of the teenage suspects in the incident.

He enrolled in the Jefferson County Sheriff’s Department’s academy July 11, 2013, graduated that December, and worked in the jail before leaving the department Aug. 23, 2017, according to records provided to 9Wants to Know.

Before that, he served in the U.S. Marine Corps from June 2008 to June 2012, deploying twice to Afghanistan. After his four-year stint of active duty ended, he spent three more years in the reserves, 9Wants to Know confirmed with the U.S. Marine Corps.

The Douglas County Sheriff's Office does not have a comment on the information contained in the affidavit.

Contact 9NEWS reporter Kevin Vaughan with tips about this or any story: kevin.vaughan@9news.com or 303-871-1862.

SUGGESTED VIDEOS | Investigations from 9Wants to Know