Police in Colorado released body camera footage Wednesday from an officer-involved shooting that occurred Friday. Video from the Littleton Police Department and the Douglas County Sheriff’s Office showed a deputy being attacked by a driver after he attempted to offer assistance to the car parked on the side of the road.

The driver attacked Deputy Brad Proulx with the butt of a gun after the officer went to help him. The body camera recording showed Proulx approaching the vehicle on the passenger side first before moving toward the driver’s side when the driver got out of the car wielding a rifle.

Proulx shot his own gun twice. The driver, identified as 25-year-old Deyon Marcus Rivas-Maestas, was hit once in the arm.

Read: Texas Police Officer Fatally Shoots 15-Year-Old Boy Leaving Party

“It certainly could have cost the deputy his life,” Littleton Police Cmdr. Trent Cooper said following the shooting. “You know, it just goes to show how unpredictable, how the situations are where this deputy thought he was making a courtesy traffic stop and helping a motorist in need and a short time later, he’s involved in an officer-involved shooting.”

Investigators said during a press conference Wednesday that the deputy “gave the subject verbal commands” and that he “feared for his life.”

“The result of this shooting is a testament to the training each of our deputies are provided,” Douglas County Sheriff Tony Spurlock said in a Facebook post Wednesday. “This just shows how necessary it is for deputies to be able to make split-second decisions, not only for their own protection but for the protection of the community.”

The driver of the car was released from the hospital after undergoing surgery and was being held at the Douglas County Detention Center on $50,000 bond.

The Littleton Police Department launched an investigation into the shooting.

The footage appeared to be captured by an Axon body camera, according to credit provided in the upper right of the video. The company that invented the Taser for police officers rebranded itself as Axon in April and launched a year-long program to equip all officers with body camera technology.

“We want officers to have the tech that they need to keep themselves and their communities safe,” Axon founder and CEO Rick Smith said in a video announcement in April.

Read: Police Suicide Rate In Chicago 60 Percent Higher Than National Average

Smith said he hoped it would usher in a “new kind of police report” in which data would be collected from officers who were wearing cameras on the job. Such a move would allow officers to spend less time on paperwork and reporting and more time assisting the public.

“It’s time for a change,” said Smith in the statement. “Our goal is to triple the time officers can spend serving their communities by automating the burden of paperwork. Sound impossible? Good. We love proving doubters wrong.”