A man who planned a shooting at a local pop culture convention has been sentenced to more than two decades in a state mental institution.

Mathew Sterling, the Valley resident who brought an arsenal of weapons into Phoenix Comicon (now known as Phoenix Fan Fusion) in 2017, was found “guilty except insane” for the crime today in Maricopa County Superior Court.

Judge Jennifer Ryan-Touhill issued the verdict and sentenced Sterling to 25 years in the Arizona State Hospital.

He was charged with attempted first-degree murder, attempted aggravated assault, aggravated assault of an officer, resisting arrest, misconduct with body armor, and carrying a weapon into a prohibited place.

Sterling was arrested on May 25, 2017, at the Phoenix Convention Center after bringing a small arsenal consisting of three loaded handguns, a loaded shotgun, a combat knife, and other weapons into the venue during that year’s event. He was also wearing body armor and carrying pepper spray and throwing stars at the time of his arrest.

Sterling reportedly intended to kill Mighty Morphin Power Rangers actor Jason David Frank, a special guest at Phoenix Comicon 2017. According to Maricopa Country Superior Court records, he set a reminder on his phone to “Kill JDF” on the day of his arrest.

Court documents say that a female friend of Sterling’s from California tipped off Phoenix police after learning of his plans over social media. Phoenix Police Department officers wrestled Sterling to the ground on the first floor of the convention center a short time later. No attendees of the event were harmed.

Sterling also reportedly told Phoenix police detectives that he considered himself to be a real-life version of Marvel Comics vigilante The Punisher. At the time of his arrest, he was clad in black tactical pants, a red bandanna, black face paint, and a shotgun bandolier containing ammunition.

The verdict comes after two and a half years of court proceedings in the case, which involved multiple evaluations of Sterling’s mental health by both his defense counsel and the Maricopa County Attorney’s Office. A one-day bench trial, which doesn’t involve a jury, occurred in December, where Ryan-Touhill reviewed the evidence in the case.

Judge Jennifer Ryan-Touhill hands down Mathew Sterling's sentence. Benjamin Leatherman

According to Arizona state law, a person can be found “guilty except insane” if they are afflicted with a mental condition severe enough at the time of their crime that they aren’t aware what they’re doing is wrong. Ryan-Touhill ruled that if Sterling is determined to be mentally competent, he will serve the remainder of his sentence in state prison.

Sterling was immediately transported to the Arizona State Hospital following the verdict to begin his sentence.

Defense attorney Dwayne Cates says Sterling will undergo periodic evaluations by the Arizona Psychiatric Security Review Board.

"He'll have a hearing in four to five months to see what his status is at that time," Cates says. "If he's deemed at some point to be restored to sanity, there are three things they can do. They can let him out, but he's still under the supervision of the state mental board [and] they can throw him back in any time they want. They can let him out under supervision, where he has to take meds or attend counseling. Or, if they think he's totally restored but just a danger to society, they can send him to the Department of Corrections to finish his [sentence].”

Cates says he was happy with the verdict.

"I'm satisfied with the court's decision today," he says. "In Maricopa County, it's very, very, very rare to have somebody found ['guilty except insane'] in court. [Prosecutors] fight tooth and nail against that."

Frank told KPNX Channel 12 in 2017 that he's forgiven Sterling.

"Do I want him to serve jail time and get mental help? Absolutely," Frank said.

Update, 2:15 p.m., 1/24/20: Kristin Rowan, a spokesperson for Phoenix Fan Fusion's parent company Square Egg Entertainment, released the following statement to Phoenix New Times:

"We are pleased to hear that Mathew Sterling will receive the medical attention he needs at the state hospital. We are forever grateful to the Phoenix Police Department and the individual who first reported the incident for their quick thinking and actions that resulted in zero injuries and kept Phoenix Fan Fusion guests, fans, vendors, and staff safe. We are happy to be able to put this matter to rest and focus on the future of Phoenix Fan Fusion and bringing our fans the best pop culture entertainment events we can."

Editor's note: A previous version of this story erroneously reported the length of Sterling's sentence, which has been corrected. Phoenix New Times regrets the error.