Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

DENVER (AP) — A Denver man who claimed that eating marijuana-infused candy led him to kill his wife was sentenced Friday to 30 years in prison in a case that helped raise concerns about the potency of pot edibles.

Richard Kirk, 50, was charged in the April 2014 shooting of Kristine Kirk at the couple's home. Moments before he shot her in the head, Kristine Kirk told a 911 dispatcher her husband was hallucinating and was getting a gun after eating pot candy.

Kirk initially pleaded not guilty to first-degree murder but right before he was about to go on trial in 2015, he changed his plea to not guilty by reason of insanity, claiming that he was intoxicated with THC, marijuana's psychoactive ingredient.

In February, he agreed to plead guilty to second-degree murder in a deal with prosecutors, avoiding a potential life sentence that could have come with a conviction on the more serious charge.

Prosecutor Helen Morgan said after Friday's hearing that Kirk's use of marijuana played a role in deciding to broker a plea deal.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"There were a myriad of factors that went into it, but it was certainly one of them. One of many," she said.

Kirk's attorneys sought lenience on the grounds that he had consumed THC to relieve back pain and it had severely impaired his judgment. They also argued he suffered "involuntary intoxication" because he did not know he was at high risk for marijuana psychosis due to schizophrenia in his extended family.

Denver District Judge Martin Egelhoff did not address that argument Friday in sentencing Kirk to the high end of the 25- to 30-year range set out in the plea agreement.

Authorities have said low levels of THC were found in Kirk's blood, and a partially eaten piece of marijuana candy was found in the house. But they have not said what role, if any, they thought pot played in the shooting.

According to investigators, the couple had escalating marital and financial problems, and Kristine Kirk had told a friend she was afraid of her husband because they had been fighting so much — a conclusion disputed by defense attorneys.

Kristine Kirk told dispatchers that her husband was acting more drunk than violent, crawling through a bedroom window and cutting his legs on broken glass. But prosecutors said he had the wherewithal to remember the code to a locked gun safe and press the weapon to his wife's head.

District Attorney Beth McCann has said that plea deal was reached because the family wanted to avoid a trial given the emotional toll they have already suffered. Under the plea deal, Kirk also allowed his wife's parents, Marti and Wayne Kohnke, to adopt the couple's three children.

"On the evening she needed me most, I wasn't there," Marti Kohnke said of her daughter. "I couldn't save her, and I will live with that guilt for the rest of my life. ... My daughter's murder was the culmination of a lifetime of his bad choices."

Last year, the Kohnkes sued two marijuana businesses that sold candy to Richard Kirk, saying they failed to warn him about its potency and possible side effects.

In response to the Kirk case and the death of a Wyoming college student who jumped from a hotel balcony after eating a potent marijuana cookie, Colorado lawmakers tightened regulations on marijuana snacks that became popular after the state legalized recreational marijuana stores. The state also now has stricter limits on how much marijuana they can contain and tougher labeling requirements.

Kirk said in court Friday that if he had not eaten the marijuana candy, his wife would still be alive.

"I had no idea how it would affect me. ... I'm so sorry that I became the monster that I was supposed to protect them from," he said of his family.