An Arizona officer who was shot and beaten a year ago by a Mexican man he was trying to help after a car crash said a passing driver saved his life by killing the man, according to newly released police reports.

State Trooper Edward Andersson said he doesn't know what led to the attack. The officer had seen Leonardo Penuelas-Escobar cradling his injured girlfriend, then set up flares to try to get drivers to slow down on a major highway. Moments later, Andersson spotted Penuelas-Escobar with a gun in his hand.

The reports say Penuelas-Escobar said something in Spanish before shooting the officer in the shoulder and beating him in the head with a handgun, which had been stolen months earlier from a home.

An armed driver saw the beating, got out of his vehicle and fatally shot Penuelas-Escobar when he refused a command to stop attacking the officer.

Andersson, a 28-year department veteran who underwent multiple surgeries for his injuries and hasn't yet returned to work, was asked during a police interview what would have been the outcome if the driver hadn't stopped the attack.

"Probably a funeral. He wasn't gonna stop," Andersson told investigators, crediting the passer-by with saving his life.

The documents released Thursday provide the most detailed account of the attack on Jan. 12, 2017, by a former member of the Mexican federal police who was in the United States illegally, according to investigators.

DPS also released the emotional interview with the Good Samaritan, Thomas Yoxall, shortly after he shot Escobar to save Trooper Andersson.

"The suspect was still on [the trooper]. I yelled at the suspect to get off him. The officer said 'help me please.' The suspect said, 'shut up," said Yoxall.

Yoxall breaks down describing what happened in the next few moments.

"I fired twice, center mass... and one in the head. He fell back. I reached down to make sure the officer was okay," said Yoxall. "The suspect lurched. At this point I shot him a third time."

Penuelas-Escobar, who was born in the Mexican state of Sinaloa, was employed in July 2007 as a police officer, but no longer held that job, the documents say. It is not clear why.

Investigators concluded Penuelas-Escobar was speeding when his car rolled over about 55 miles west of Phoenix, ejecting Vanessa Monique Lopez-Ruiz, 23. She later died.

The driver who killed Penuelas-Escobar wasn't charged with a crime. Arizona has a law that lets someone use deadly force against a person who is threatening or injuring another person.