Dramatic footage has captured the moments right before a California police officer shot a suspect.

Oxnard Officer Daniel Oncea is seen on home surveillance video confronting Joel Tapia Jr, 30, who was wanted on outstanding warrants, on July 29 in the Royal Duke Mobile Estates.

Tapia resists the officer's attempts to arrest him and the two engage in a struggle with Tapia trying to reach for the officer's gun as well as punching him multiple times.

The suspect releases himself from Oncea's grasp and flees but not before Oncea picks up his gun and manages to fire, hitting Tapia in the arm, reported the Ventura County Star.

Dramatic footage has captured the moments right before Oxnard Officer Daniel Oncea shot 30-year-old Joel Tapia Jr on July 29 in Ventura County

Oncea was seen on home surveillance video confronting Tapia who was wanted on outstanding warrants. Tapia resists the officer's attempts to arrest him and the two engage in a struggle

The struggle lasted for two-and-a-half minutes during which Tapia (left and right, in mugshots) grabbed at the officer's lapel, attempted to trap Oncea's neck, and grabbed for the officer's weapon. The gun fell out of the holster and onto the ground where Tapia was seen trying to grab it

Oncea was patrolling the area around 7.21pm when he recognized Tapia, whom Oncea knew had several outstanding warrants.

On the surveillance video, Oncea is seen approaching Tapia, who is between two vehicles.

However, in Oncea's initial attempt to arrest Tapia, the 30-year-old resists and the two engage in a struggle that spills out into the street.

The struggle lasted for two-and-a-half minutes during which Tapia grabbed at the officers'a lapel, attempted to trap Oncea's neck, and tried to reach for the officer's weapon.

The gun fell out of the holster and onto the ground where Tapia is seen attempting to grab it.

Eventually, he punches Oncea a few times before fleeing. Oncea grabbed his weapon and fired - shooting Tapia in the arm.

Eventually, he punches Oncea a few times before fleeing. Oncea grabbed his weapon and fired - shooting Tapia in the arm. Oncea's body camera did not capture the incident although it is unclear why

Tapia hid out in a mobile home for several hours after being shot until a SWAT team and a K-9 unit forced him out around 11pm. He was taken to the Ventura County Medical Center and was treated for a gunshot wound

According to the Ventura County Star, Oncea's body camera did not capture the incident although it is unclear why.

'Overall, the video clearly illustrates the dangers of police work,' Assistant Police Chief Jason Benites told Fox 13.

'There are those that who will not only resist our officers from taking them into custody, but there are some who will actively assault an officer to the point where they escalate a situation to a shooting.'

Tapia Jr hid out in a mobile home for several hours after being shot until a SWAT team and a K-9 forced him out around 11pm.

He was taken to the Ventura County Medical Center and was treated for a gunshot wound.

After he was released on Thursday, he was booked into Ventura County Jail on three felony charges including forcefully resisting arrest, battery causing injury to a police officer and attempting to take an officer's firearm.

After he was released on Thursday, Tapia was booked into Ventura County Jail on three felony charges including forcefully resisting arrest, battery causing injury to a police officer and attempting to take an officer's firearm

According to court records obtained by the Ventura County Star, Tapia's outstanding warrants were related to a shoplifting incident in January and a resisting arrest charged and as well as a DUI in September

In an appearance in court on Friday, he pleaded not guilty to all of the charges.

According to court records obtained by the Ventura County Star, Tapia's outstanding warrants were related to a shoplifting incident in January and a resisting arrest charge and as well as a DUI in September.

In the September case, he had been released of his own recognizance, the records showed.

He is currently being held on $1.025million bail and is next scheduled to appear in court on Tuesday.

The district attorney's office told the Star that Tapia could be facing jail time up to eight years and four months.

Oncea suffered minor injuries in the incident and was treated at St John's Regional Medical Center.

According to a statement from the Oxnard Police Department, Oncea has been employed there since August 2017 works in the Patrol Division.

Per standard procedure, he has been placed on paid administrative leave, the statement read.