A Hopkins man has admitted to fatally stabbing his longtime friend but contended he had no memory of the killing because of the marijuana gummies he had just eaten mixed with alcohol and a prescription drug.

Daniel K. Johnson, 63, pleaded guilty Wednesday in Hennepin County District Court to second-degree murder in the death of 66-year-old Clayton Kartak on March 29 in the victim’s Hopkins apartment.

The plea deal calls for Johnson to receive a sentence ranging from 13¾ years to 15¾ years. With credit for time in jail since his arrest, Johnson would serve anywhere from 8¾ years to slightly more than 10 years in prison and then the balance on supervised release. Sentencing is scheduled for Oct. 23.

During his guilty plea, Johnson contended he could not recall the killing because he blacked out after getting drunk, taking his medication and downing marijuana gummies. Law enforcement testing soon afterward measured Johnson’s blood-alcohol content at 0.18%.

Officers went to the apartment building at 9 7th Av. S. about 10:30 p.m. following a report of a man holding a butcher knife and knocking on doors with bloodied hands. They found Johnson curled up in the hall, the bloody knife at his feet.

Police arrested him and noted that he smelled of alcohol and was speaking about “spirits and ghosts” and “helping them kill someone.”

Officers found Kartak dead on his living-room floor.

People who knew the men described them as friends who would routinely get together to drink and consume marijuana. No one who spoke to police was aware of any friction between the two.

Johnson was convicted in November of theft and was sentenced to 45 days in the Hennepin County workhouse and put on supervised probation for three years. Terms of the probation included staying out of legal trouble. He’s also been convicted of disorderly conduct, assault, drunken driving and drug possession.