LOS ANGELES (AP) -- A gunman in Southern California fatally shot his ex-wife and a man at a trucking company before chasing after another man, killing him, and then driving to a home where he killed a father and daughter during a nearly 40-minute rampage, authorities said Thursday.
Kern County Sheriff Donny Youngblood identified the gunman as Javier Casarez during a news conference about the shootings that claimed five victims in Bakersfield, about 90 miles (145 kilometers) north of Los Angeles.
Casarez, 54, fatally shot himself as a deputy closed in on him shortly after the shooting.
Court records show a divorce between Casarez and his wife Petra Maribel Bolanos de Casarez was finalized in April.
Bolanos recently filed for a change involving child support and custody over the couple's two teenage children, and the pair had a hearing set for Oct. 11, court records show.
Youngblood said it appears that Casarez targeted every victim, starting with a worker at T&T Trucking, and that domestic violence appears to have played a large part.
"It appears to be there's more than just husband and wife having a fight because other people were targeted," he said. "There's a reason for that and we need to find that reason."
Casarez likely took his ex-wife to the trucking company against her will and then fatally shot 50-year-old Manuel Contreras with a .50-caliber handgun, authorities said. He shot his ex-wife and then turned the gun on a second man, 50-year-old Antonio Valadez, the sheriff's department said.
Casarez fired at Valadez as he ran away, but then tracked him down in his car and killed him, the sheriff said.
Casarez then drove to the house of 57-year-old Eliseo Garcia Cazares, who Youngblood identified as a friend. Casarez fatally shot Garcia and his daughter, 31-year-old Laura Garcia.
"She may have tried to intervene to keep the suspect from approaching her father, and he shot and killed both of them," Youngblood said.
After the shooting at the Garcia home, Casarez carjacked a woman driving with her child. The woman and child escaped, and Casarez drove to a highway where a sheriff's deputy saw him, Youngblood said.
As the deputy closed in, yelling at Casarez to drop his gun, Casarez fatally shot himself in the stomach, according to graphic body camera footage released by police on Facebook.
The video shows deputies and paramedics working to save Casarez. Deputies look over Casarez's gun and talk about how he would have had to reload it during the rampage.
David Bunting, who said he's a friend of Eliseo Garcia Cazares and lives two doors down from him, said he has no idea why his neighbor would have been targeted.
He said Garcia was a self-employed truck driver who always was with his grandkids when not working, often driving them around on his golf cart.
"He's a really nice guy. I can't say enough good things about him," Bunting said. "It's kind of a shock because of the kind of a person he was."
He said his daughter Laura was a mother of four and that most of the Garcias' large family was home at the time of the shooting. He said they're devastated and in shock.
He said Eliseo Garcia Cazares and his wife had four grown children, including a daughter who was killed in a car accident a few years ago.
T&T Trucking, where the initial shooting happened, said in a statement that the company "is in a state of mourning."
"We are greatly saddened and offer our heartfelt condolence and prayers to those who lost a loved one."
About 30 witnesses were being interviewed by deputies, Youngblood said.
He said Casarez was a legal permanent resident of the U.S. The 50-caliber gun used in the shootings was legally purchased in 2004, Youngblood said. Casarez had been arrested for vehicle theft in the 1980s, but he did not have a history of violent crime, the sheriff said.
Officials say there are indications of a domestic violence motive, but investigators don't know what specifically set Casarez off.
Casarez filed for divorce last year because he believed she had cheated on him, according to court papers. In his petition for divorce filed in December, he accused Petra Maribel Bolanos De Casarez of cheating and asked the judge for his wife's text messages to specific phone numbers. The judge denied the request.
Investigators are looking into whether Casarez's ex-wife may have had a relationship with Contreras or Valadez, the sheriff said.
His ex-wife had recently filed for an unspecified change in orders involving child support and property.
Youngblood called the shootings devastating, especially for Laura Garcia's children, who may have witnessed their mother's death.
"These young children, when they see this, that's something that will stay with them the rest of their lives," he said. "But officers ... they're also not immune to those emotions. Those cases stay with them their entire career, so this has a far-reaching impact on a lot of people in our community and in our department."
Associated Press writer Christopher Weber contributed to this report.