A Douglas County sheriff's deputy who was shot down in a confrontation inside a Highlands Ranch apartment had extensive contact with the gunman beforehand – working to calm the man after a dispute with his roommate.

The encounters between Deputy Zack Parrish, who died after a burst of gunfire early the morning of Dec. 31, and the man who killed him were captured on body cam video released Tuesday by the Douglas County Sheriff's Department after an open records request from 9NEWS and other media outlets.

The footage provides the fullest accounting yet of what happened at the Copper Canyon Apartment Homes, 3404 E. County Line Road.

Still, key questions remain: For nearly 21 minutes leading up to the decision to enter Matthew Riehl's apartment – a move that ended in a fatal burst of gunfire – deputies huddled and apparently discussed what actions to take against a man who had displayed odd behavior and had access to guns. But the footage from that time includes no audio.

RELATED | Body cam raises questions about what led deputies to entering apartment

RELATED | Portions of body cam footage from DougCo ambush shooting released

It was impossible to determine whether the four deputies then at the scene and their sergeant sought direction from others about how to deal with Riehl, a 37-year-old man with a history of mental issues and problems with police officers – a man those officers knew had guns. After two separate encounters, Riehl slammed the apartment door in the face of those deputies and retreated to his bedroom.

They ultimately entered the apartment, moved to a small hallway outside his door, kicked the door, and ordered the man to come out of his room. Less than a minute after that confrontation began, Riehl opened fire from behind his door, fatally wounding Parrish and hitting deputies Mike Doyle, Taylor Davis, and Jeff Pelle – and two neighbors in a nearby unit.

Riehl himself died in a subsequent exchange of gunfire that also injured Castle Rock police officer Tim O'Donnell.

In a 10-minute interview Tuesday afternoon before the department provided the video footage, Douglas County Sheriff Tony Spurlock defended the way the officers handled the situation – and rejected the idea that they could have called a SWAT team to attempt to take Riehl into custody.

“It's just not – one – appropriate and feasible to call a SWAT team on every mental health call,” Spurlock said.

He said the department has handled more than 500 such calls since instituting what is known as the Critical Response Team – a trio that includes a deputy, a mental health therapist and a paramedic.

“This is the first one that's gone this violent,” Spurlock said. “And so I'd say that we continue to do exactly what we're doing, handle them the exact same way. But there are things that our community could do in regards to mental health and making sure that we have some place and some care for folks that have mental health issues.”

But that specialized team wasn't on duty that morning, Spurlock said. So it was up to the responding officers to handle Riehl.

“All of our deputies get trained in dealing with mental health issues, recognizing folks who have mental health issues and looking for signs that would give them an indication that someone's having some type of an issue,” Spurlock told 9NEWS.

The video released Tuesday lays out the sequence of events in graphic detail.

It began around 3 a.m. after Parrish and other deputies responded to a complaint that Riehl was making noise.

RELATED | Widow of Deputy Zack Parrish reads final love letter to him at funeral

The footage from Deputy Parrish's own camera shows him moving back and forth between Riehl and his roommate, who complains that he was trying to get the man to quiet down because it was the middle of the night.

Eventually, Parrish spends several minutes talking in calm tones to Riehl against a wall outside the apartment. At one point, Riehl seems to grow agitated about questions over the status of his relationship with his roommate.

“The reason we need to ask those hard questions that are tough to answer is because we need to make sure you're okay,” Parrish tells Riehl as they talk calmly.

“What was your first name again?” Parrish asks a few minutes later.

“Matthew,” Riehl responds.

“Matthew – Zack,” the deputy tells him. “Good to meet you.”

After more discussion, the deputies left, believing the situation was under control.

Then, at 5:14 a.m., Riehl himself called 911. The dispatcher who sent Parrish and other officers to the scene told the deputies that he had “weapons at the home that aren't secure.”

The video footage shows the officers arriving in the pre-dawn darkness at Riehl's apartment and climbing the long outdoor staircase to his door.

Parrish raps on the door and yells, “Matt.”

“Yes,” Riehl answers, without opening the door.

“It's Deputy Parrish”

“Hey,” Riehl answers, “what's up – you're back?”

But the discussion begins going downhill – Riehl refuses Parrish's request to allow him into the apartment, then eventually opens the door, his head next to the knob, a cell phone in his hand filming the encounter live on the internet.

“Are you okay?” Parrish asks at one point. Riehl tells the officer he wants to file a restraining order against his roommate, then accuses the officer of not helping him when he was there earlier.

At one point, Parrish offers the man a phone number where he can get help with the restraining order. A moment later, Riehl abruptly slams the door.

“It's okay,” Parrish tells the other officers. “He is going through a manic episode.”

A short time later, Parrish tells the other officers he is going to take Riehl in on an “M1” hold – a code for taking someone to a mental health clinic.

Parrish and Riehl continue to communicate through the door – much of it is hard to discern.

“Good night,” Riehl yells at one point. “Go away.”

Nine minutes after deputies arrived, Parrish tells the other officers: “Let's back off this door, in case he does get a gun. Get in position. And if he opens the door then we'll just go in.”

A minute later, the deputies retreat from the parking lot and the audio goes silent. Nearly 21 minutes later, it comes back on with the officers discussing guns that Riehl – a National Guard veteran – may have.

Almost 33 minutes after arriving at the scene, the deputies and Sgt. Dave Beyer go back to the apartment door with a key – apparently obtained from Riehl's roommate.

They enter, moving clutter – including an ironing board – out of the way and approach Riehl's room. The door is located down a short, narrow hallway.

They are about to encounter a man who used two military-grade semiautomatic rifles, a semiautomatic pistol and a shotgun – photos of which were made public by the sheriff's office Tuesday.

“Sheriff's office,” one of the deputies shouts.

“Matt, come out,” another yells out. “Matt, come out of the room now.”

Parrish and Deputy Davis both kick the door to Riehl's bedroom – and less than a minute after they enter the apartment, gunfire erupts from the other side.

The video captures the frantic moments as Davis, Doyle and Pelle reel from the gunfire, each of them hit.

Davis bolts to her left, smashes out a window and jumps to the ground below.

“I'm hit – I'm hit,” she yells as she runs for cover, gunfire sounding above her.

At the same time, Doyle and Pelle – one of them yelling “backup, backup, backup” – retreat out the door onto the landing.

“I'm shot,” someone yells.

They realized then that Parrish was down.

“I'm going – cover me,” one of them yells, attempting to reach Parrish to pull him from the apartment.

Then gunfire erupts again, and at least one of them is hit. They scramble back out the door to the stairs, running down the steps.

“I'm shot in the vest,” Pelle yells.

“I'm in the arm and the leg,” Doyle says.

They ended up in the grass below the apartment, radioing for help, trying to assess their wounds and the location of Parrish and Davis.

Doyle tries to reassure Pelle that he'll be okay while also telling Sgt. Beyer that he needs a tourniquet on his arm. At one point, the officers took off running after Riehl started firing out his apartment window.

They reunited with Davis – realizing that Parrish was still inside.

“We need help for our deputy down on the outside,” Davis said into her radio. “We have one deputy down on the inside the apartment. I'm not getting anything from him. All of us have been hit at least once.”

All three were rushed to hospitals.

Over the next 90 minutes, Riehl sporadically fired from the apartment as a SWAT team prepared to move in. Just before 7:30 a.m., SWAT officers entered the apartment, grabbed Parrish and killed Riehl in a final exchange of gunfire.

For Parrish, it was too late.

9NEWS investigative producer Katie Wilcox contributed to this report.

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