As an Arizona trooper was working to help a motorist caught in a rollover crash, a random suspect shot him. Thankfully, though, a gun-wielding good Samaritan was there, and he had the officer's back.

The trooper, who is with the Arizona Department of Public Safety, was at a traffic stop when he received the call, according to KABC-TV, about a nearby driver whose vehicle had been shot at.

Shortly after the officer left the traffic stop, he came across a rollover crash and noticed a woman had been ejected from the wreckage. But as the trooper, who has been with the department for more than 25 years, began to block off the road, a suspect approached him from an unknown direction and "ambushed" him, the DPS reported.

The suspect shot him at least once between the chest and shoulder and then fought the trooper to the ground. Luckily, a passerby saw the entire fight and stopped to see if the trooper needed any help.

When the good Samaritan asked the suspect to stop, the assailant ignored the order — a decision that didn't bode well for the trooper's attacker. Moments after the suspect continued attacking the officer, the passerby hurried back to his car, grabbed his gun and fatally shot the suspect.

"Thank you, because I don't know if my trooper would be alive today without your assistance," DPS Col. Frank Milstead told the gun-weilding passerby, telling KNXV-TV that the good Samaritan "absolutely" saved the trooper's life.

The trooper was taken to the hospital where he is awaiting surgery. He is in stable condition, according to the DPS.

Unfortunately, the woman who was ejected from her vehicle as a result of the crash died from the injuries she sustained. The cause of the wreck is unknown.