 -- A motorist who witnessed an Arizona state trooper being physically assaulted by a man along a remote stretch of Interstate 10 early Thursday morning took matters into his own hands and fatally shot the perpetrator, who shot the trooper before the motorist's arrival, officials said.

"My trooper would not be alive without his assistance," Department of Public Safety Director Ralph Milstead said of the motorist.

The bizarre incident began around 4 a.m. when the officer, a 27-year veteran, responded to a separate driver's call about gunfire in the area. Milstead said the driver had called police to report being shot at while driving along Interstate 10. It’s unclear if the person who fired at the vehicle is the suspect who shot the trooper.

As the trooper arrived in the general vicinity where the caller had reported being shot at, the trooper spotted a rollover car wreck, where a woman was ejected. She was later pronounced dead on arrival at the hospital.

As the trooper was blocking off lanes and setting up flares, the assailant shot the trooper in the chest and then proceeded to physically attack him, Milstead said. Police said they believe that the man who shot and assaulted the trooper was the driver of the vehicle that crashed.

The man was "getting the better of him," slamming the trooper's head against the pavement, Milstead said.

At that point, the passer-by — having noticed the altercation — pulled over and asked the officer if he needed help, to which he said yes.

The motorist then retrieved a gun from his car and fatally shot the suspect, Milstead said.

The wounded trooper, whose name has not been released, was transported to a hospital, where he is in stable condition.

Milstead said he hasn’t yet had the opportunity to speak to the motorist but he wants to thank him.

Officials have not yet confirmed the suspect’s identity or the deceased occupant of the vehicle, Milstead added.

The incident remains under investigation.

ABC News' Michael Kreisel and Liz Kreutz contributed to this report.