HIGHLANDS RANCH, Colo. — The investigation into a suspected incident of “friendly fire” during the attack on a Highlands Ranch school centers on reports that a private security guard saw the muzzle of a gun come around a corner and shot back, 9Wants to Know has learned.

But that muzzle was apparently the gun of a responding Douglas County sheriff’s deputy, who was not wounded in the incident, multiple law enforcement sources confirmed Friday.

The security guard, who works for BOSS High Level Protection, was reported to have fired two shots at the sheriff’s officer in the midst of the attack Tuesday afternoon that left one student dead and eight others wounded, sources with knowledge of the investigation said.

RELATED: 1 student killed, 8 others injured when classmates open fire at STEM School Highlands Ranch

RELATED: Court dates rescheduled for suspects in STEM School Highlands Ranch shooting

Investigators are also looking into the possibility that a bullet fired by that security guard may have hit and wounded one of the students who was injured in the attack. That question is not likely to be settled until all ballistics testing is completed.

The sheriff’s officer, who has not been identified publicly, could not be reached Friday for comment.

It was first reported Wednesday night by 9NEWS that authorities were investigating an incident of suspected friendly fire involving the private security guard. The new information suggests that security guard perceived a threat and fired his gun in response to it.

RELATED: Hero students? Many schools embracing approach in shooting situations

RELATED: ‘There was a shooting at my son’s school today’: A STEM School Highlands Ranch dad’s heartbreaking Twitter thread

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.

Robert Burns, an attorney for the security guard, could not be reached on Friday. Thursday, he declined to answer the question of whether the guard fired on a sheriff’s officer.

“At this time I can’t confirm or deny any specific action my client may or may not have taken,” Burns said. “What I can say is I believe he acted in a manner that prevented further harm, bloodshed, violence to the students and the faculty. But beyond that I can’t really go into specifics.”

RELATED: 'Perfect storm': District letter documents fears of another 'Columbine' at STEM School

RELATED: STEM School students walk out of planned vigil, frustrated by political talk

One student, Kendrick Castillo, died after he and classmates rushed one of the two gunmen – both teenagers – who entered the school at 8773 S. Ridgeline Blvd shortly before 2 p.m. Tuesday.

The suspects were both identified by Douglas County Sheriff Tony Spurlock as students at the school, which has an enrollment of 1,850. Both were taken into custody, and both appeared in court Wednesday.

An 18-year-old student was advised that he was being held on suspicion of one count of first-degree murder after deliberation and 29 counts of attempted first-degree murder after deliberation. The other suspect is a 16-year-old. A decision on whether to charge that suspect as an adult will is expected next Wednesday, when the pair are scheduled to be back in court.

RELATED: STEM School shooting: Ways to lend support

RELATED: STEM School Highlands Ranch shooting: 9NEWS coverage of the tragedy

They went to the school with three handguns and a rifle, which investigators believe they stole after using a crowbar and an ax to break into a gun safe owned by the father of the 18-year-old. The two also apparently attempted to light a fire at the house, but it did relatively minor damage.

Tuesday’s report of “shots fired in the school” brought an immediate response from multiple Douglas County deputies and command officers.

One of those officers later reported the incident with the private security guard to investigators.

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

MORE COVERAGE: 9NEWS coverage of the shooting at STEM School Highlands Ranch