SAN JOSE (CBS SF) — The Santa Clara County Sheriff’s Office early Tuesday evening released dramatic body camera video from deputies who first responded to the mass shooting at a Santa Clara Valley Transportation Authority (VTA) railyard in San Jose last week.

“The work they did that day is heroic,” said KPIX Security Analyst Jeff Harp.

The video clip shows almost four-and-a-half minutes of the tense approach deputies and police officers made with their guns drawn across the railyard and into the buildings where the shootings took place.

“By the size of this building, the fact that they were able to go into the office area where he was located is amazing,” said Harp. “They did it right, I mean, they went to the sound of the gunfire. I’ve trained in these scenarios a number of times. It’s very, very difficult.”

VTA employee Samuel Cassidy went on a bloody rampage early last Wednesday morning, killing nine of his coworkers before turning a gun on himself as authorities converged on him.

Authorities with the Santa Clara County Sheriff’s Office and the San Jose Police Department, along with additional investigators from federal agencies including the FBI and the ATF, have been unraveling the horrific timeline of the mass shooting at the VTA facility and a possible motive behind the shooting since last week.

The body camera video was released by the sheriff’s office at 5 p.m. on Tuesday and can be seen below. Warning: Graphic Content

The 57-year-old Cassidy fired 39 bullets before killing himself as police officers and sheriff’s deputies closed in. The gunman was armed three semiautomatic handguns and 32 loaded high-capacity 12 round magazines, according to Santa Clara County Sheriff Laurie Smith.

In the video clip released Tuesday, a first contact team of a Sheriff’s Sergeant, a Sheriff’s Deputy and three San Jose Police officers are seen crossing the railyard before making a tense ascent of an exterior staircase on the outside of Building A at the VTA facility where the shooter was thought to be located.

At the top of the stairs, the deputies encounter a VTA employee who raises his hands over his head and backs slowly towards authorities before handing over his key card so they can access the building.

The deputies and officers proceed through the building, hearing gunshots nearby as they move cautiously from room to room. Authorities eventually come upon Cassidy sitting at a desk near the top of a stairwell, dead from self-inflicted gunshots.

Authorities said Cassidy initially shot himself under the chin, but when that didn’t prove fatal, he shot himself a second time in the head. However, before he took his own life, he fired upon deputies first. The bullet pierced a window at the entrance of the room where the suspect was found. However, whether it was intended for law enforcement who had just arrived remains under investigation.

Sheriff Laurie Smith said more than 100 employees were at the rail yard that day, and that more lives would have been lost had it not been for the deputies’ and officers’ quick entry into the building. The agencies often train together.

“This protocol, I believe, saved lives. He had a lot of additional ammunition,” Smith said. “We’ll never forget those innocent victims whose lives were taken by a crazed coward.”

The Santa Clara County Medical Examiner-Coroner on Tuesday evening issued an autopsy report confirming that Cassidy’s death was a suicide by multiple gunshot wounds to the head.

“Although rare, this can occur in suicides in which the first shot to the head was not immediately fatal,” the release from the Medical Examiner-Coroner’s Office read. The statement also said its conclusion came “following a thorough crime scene investigation and autopsy.”

According to the timeline provided by the sheriff’s office, dispatch first received the call regarding the shooting at about 6:35 a.m. Remarkably, only ten minutes had passed by the time authorities had found Cassidy dead by his own hand.

It took over two days for authorities and bomb squad personnel to clear the huge arsenal of explosives, weapons and ammunition found at Cassidy’s San Jose home where he had intentionally started a fire before heading to the VTA facility.

Among the items found by authorities investigating the house on Angmar Court in East San Jose were a dozen weapons, 17 Molotov cocktails and approximately 25,000 rounds of ammunition of various calibers, according to the Santa Clara County Sheriff’s Office.

Last week, Smith said she believed that some or all of the victims were targeted.

“It appears to us at this point that he said to one of the people there: ‘I’m not going to shoot you,’” Smith said. “And then he shot other people. So I imagine there was some kind of thought on who he wanted to shoot.”

A federal official confirms to CBS News that Cassidy had been detained by U.S. Customs and Border Protection after returning to the States from the Philippines in 2016 due to the writings found in his possession. The Wall Street Journal first reported this.

According to the New York Times, in addition to a notebook that Cassidy had written in detailing how much he hated the VTA, officials found books on the subjects of terrorism and manifestoes.

Cassidy reportedly told agents he had no problems with people at work. The information regarding the 2016 incident is contained in a DHS memo concerning the encounter.

VTA on Monday said there was currently no timeline for re-opening light rail service after the deadly mass shooting last week.