PHOENIX (AP) — Authorities used a stun gun but it failed to subdue a 20-year-old suspect who has been charged with first-degree murder in the shooting of a rookie Arizona state trooper, according to court records released Monday.

The stun gun was used as six officers, including local police, struggled with suspect Isaac Damon King for about eight minutes after callers said he was throwing rocks at passing cars on Interstate 10 near Phoenix, the records state.

Trooper Tyler Edenhofer, 24, died during the roadside struggle Wednesday when the attacker somehow got hold of another trooper's gun and fired two shots — killing Edenhofer and wounding another trooper in the shoulder, authorities say.

King was charged with two counts of attempted first-degree murder, multiple counts of aggravated assault, three counts of endangerment and resisting arrest.

He has not entered a plea.

Seth Apfel, an attorney for King, didn't immediately return a call Monday seeking comment.

King was admitted to a hospital for treatment of undisclosed injuries after the shooting and was in a medically induced coma for a time. He was charged Sunday when he appeared via a video link before a judge.

King, who lives in Avondale, was on medication for anxiety and depression and had no previous criminal record, DPS officials said.

Just how the attacker got hold of the weapon and was able to fire it remained under investigation, said DPS Col. Frank Milstead. He said the weapon was in a standard leather holster tethered to the officer's belt.

Edenhofer was killed just two months after graduating from the Arizona Department of Public Safety academy. The 24-year-old U.S. Navy veteran was engaged to be married.

Several hundred people turned out Monday evening on the lawn of the Arizona State Capitol for a candlelight vigil. Most help up cellphone lights instead of flames, per DPS request.

Gov. Doug Ducey offered his condolences and praised the way Edenhofer lived his life in service to others.

Edenhofer's funeral is set for Friday in Peoria.