PHOENIX (AP) — The man who shot and severely beat an Arizona state trooper last week was a former member of the Mexican federal police who was in the country illegally, authorities said.

He had rolled his car on Interstate 10 before he inexplicably attacked the officer who had stopped to help.

Leonard Pennelas-Escobar opened fire on Trooper Edward Andersson early Thursday after the officer had stopped on the interstate and set up flares in a bid to get motorists to slow down. Pennelas-Escobar said something unrecognizable in Spanish before shooting the trooper, and then he started landing blows with his fists and beating the trooper's head on the ground, Department of Public Safety Director Frank Milstead said Monday.

A passing motorist who witnessed the attack retrieved a handgun from his vehicle and fired two shots at Pennelas-Escobar after he refused an order to stop attacking Andersson. With Pennelas-Escobar incapacitated, the motorist tended to the wounded trooper but was later drawn back into the dispute when Pennelas-Escobar got up and resumed his assault on Andersson. The motorist then fired a fatal shot at Pennelas-Escobar.

"He definitely kept him (Andersson) from having much more serious neurological injuries from this beating," Milstead said.

For more news videos visit Yahoo View, available now on iOS and Android.

Milstead called a news conference Monday to offer more detail on the chaotic scene, but he was unable to provide an explanation on why Pennelas-Escobar attacked the officer.

The 37-year-old Pennelas-Escobar was in the country illegally, a drug user and was believed to have once worked as a Mexican police officer, Milstead said. Still, Pennelas-Escobar had no known criminal history.

Andersson arrived at the rollover scene about 55 miles west of downtown Phoenix to find Pennelas-Escobar holding his injured girlfriend, 23-year-old Vanessa Monique Lopez-Ruiz, on the edge of the roadway.

She had been ejected in the high-speed rollover and was later pronounced dead. The cause of the collision hasn't yet been determined. Pennelas-Escobar was believed to have been the vehicle's driver.

Story continues

Andersson, a 27-year department veteran, suffered gunshot wounds to the right shoulder and chest. He underwent surgery and has since been released from the hospital.

The motorist who shot Pennelas-Escobar hasn't spoken out publicly about the shooting.

Milstead said the motorist didn't serve in the military or work as a law enforcement officer, but he still had experience in using firearms. The DPS director described the motorist as a humble man with a strong religious faith.

"He knows he did the right thing," Milstead said. "He is trying to reconcile that in his mind, which is difficult to take a life even when you know it's the right thing to do."

Arizona has a "defense of third person" law that allows someone to use deadly force against another who is threatening or injuring a third person. It was not unusual that the passing driver was armed in this gun-friendly state with loose regulation.

___

Follow Jacques Billeaud at twitter.com/jacquesbilleaud. His work can be found at https://www.apnews.com/search/jacques%20billeaud.