A hero passer-by shot and killed a gunman who ambushed an Arizona state trooper who was helping at the scene of a car crash.

The trooper was helping a woman who had been ejected from a car in a rollover crash when he was brazenly attacked by the suspect.

But a Good Samaritan stepped in and gunned down the assailant in the middle of the road.

Now the Arizona Department of Public Safety are trying to find the hero who intervened, because they believe the trooper may not be alive if it weren't for her actions.

Scroll down for video

A trooper was trying to help a driver in a car accident when he was shot in an ambush by a man was then shot dead by a Good Samaritan driving by

The trooper is with the Arizona Department for Public Safety, near Tonopah, and was helping a woman in a rollover crash who had been ejected from the wreckage

When he started to block lanes and put out flares, a suspect ambushed him, opening fire then physically attacking him

DPS Director Frank Milsted sent a message out to the Good Samaritan, who he has yet to talk to. He said: 'Thank you because I don't know if my trooper would be alive today without your assistance.'

A separate driver reported gunfire and a trooper was responding to that call when he spotted the car crash and stopped, Milstead and DPS Captain Damon Cecil said.

When he started to block lanes and put out flares, a suspect ambushed him, opening fire then physically attacking him.

The trooper was shot at least once near his chest and fought to the ground by the suspect. The man was on top of the officer and 'getting the better of him,' slamming the trooper's head into the pavement.

That's when the passerby spotted the altercation and asked the officer if he needed help. The officer said yes, and when the suspect ignored the passerby and continued attacking the trooper, the Good Samaritan shot him dead.

The trooper was shot at least once near his chest and fought to the ground by the suspect. The man was on top of the officer and 'getting the better of him,' slamming the trooper's head into the pavement

That's when the passerby spotted the altercation and asked the officer if he needed help. The officer said yes, and when the suspect ignored the passerby and continued attacking the trooper, the Good Samaritan shot him dead

DPS said that the trooper has been with the department for 27 years, and awaits surgery in hospital.

Milstead said he feared the worst when he headed to the hospital to check on the wounded trooper, who is stable.

He said: 'He's incredibly fortunate to be here with us today.'

The woman involved in the rollover crash died from her injuries, and it is unknown what caused the accident.

DPS Director Frank Milsted sent a message out to the Good Samaritan, who he has yet to talk to. He said: 'Thank you because I don't know if my trooper would be alive today without your assistance'

Officials said they were trying to determine exactly what happened and that the investigation faced major hurdles with the trooper seriously injured and two of the others involved dead

DPS said that the trooper has been with the department for 27 years, and awaits surgery in hospital. Milstead said he feared the worst when he headed to the hospital to check on the wounded trooper, who is stable

Officials said they were trying to determine exactly what happened and that the investigation faced major hurdles with the trooper seriously injured and two of the others involved dead. No identities have been released.

Investigators were trying to determine how the rollover happened and whether the suspect was involved with the initial report of gunshots, officials said. Investigators plan to speak with the person who made that call.

Westbound Interstate 10 was closed most of the morning, and traffic heading for California and western Arizona was detoured to other highways.