Offering a possible motive into his shooting rampage, the man suspected of killing his ex-wife and four other people in Bakersfield had filed for divorce last year, claiming his then-wife was cheating on him, court documents show.

Six people were killed in the two separate but related shootings on Wednesday - including the suspect who killed himself after being confronted by a sheriff's deputy, officials said.

The gunman was identified as 54-year-old Javier Casarez, who used a .50-caliber handgun in the shooting spree.

According to the sheriff, the suspect's ex-wife, 45-year-old Petra Maribel Bolanos De Casarez, was among the victims.

Kern County Sheriff's Office has released body cam footage of the moment deputies confronted the suspect who killed five people and then turned the gun on himself.

Casarez's estranged wife and 50-year-old Manuel Contreras were shot by Javier Casarez after the gunman confronted Contreras at the business. Casarez then chased 50-year-old Antonio Valadez from that scene and killed him in front of a sporting goods store. The shooter then went to a residence and killed 32-year-old Laura Garcia and her father, 57-year-old Eliseo.

The daughter may have been shot when she tied to intervene, investigators said.

Family members described Garcia as a loving mother of four who will be missed by all who knew her. KERO-TV also identified Garcia's father, self-employed truck driver Eliseo Garcia, as another victim. The station said family members described him as a husband, father and grandfather.

Family shared this photo of Eliseo Garcia, yet another one of the victims killed in Wednesday’s shooting spree in southeast Bakersfield. He was a husband, father and grandfather. The motive behind these murders is still unknown. @23ABCNewspic.twitter.com/xzcxasMgxv

#BREAKING: This is 32-year-old Laura Garcia. She and her father were killed at their family’s home on Breckenridge Road after a gunman killed his wife and two others in southeast Bakersfield. We’re told she was a loving mother will be missed by all who knew her. @23ABCNewspic.twitter.com/Ba84DHXNzs

The suspect then went to Fillmore Avenue, where he hijacked a vehicle. A woman and child in the vehicle escaped safely.

The suspect drove down Edison Highway to a friend's business, where a deputy saw the suspect and confronted him. The suspect then shot himself in the chest and died at the scene. The deputy did not fire in the confrontation.

At a Thursday morning press conference, Kern County Sheriff Donny Youngblood released body-camera footage that shows the armed deputy approaching Casarez before the suicide.

"Put the gun down," the deputy is heard repeating at least four times. Casarez then pulls the trigger.