Alexander Kinyua on Monday pleaded guilty to charges that he killed a family friend with an ax and ate his heart, but a Harford County judge ruled the defendant was not criminally responsible for the act because of mental illness.

The decision means Kinyua, 22, will not be sent to prison in the gruesome Joppa, Md., killing. Instead, Kinyua will remain committed to a mental health facility indefinitely, unless a judge finds that he is healthy and no longer dangerous.

Those close to 37-year-old victim Kujoe Bonsafo Agyei-Kodie questioned how long Kinyua would be held, telling prosecutors they could derive little comfort from the resolution.

Percess Veronica Mattison, a family friend, described “startling moments of stark disbelief” about the circumstances of Agyei-Kodie’s death.

Kinyua, a former Morgan State University student, pleaded guilty to first-degree murder in the 2012 killing. Just days before the killing, he had been released from jail on charges that he partially blinded a fellow student by hitting him with a baseball bat.

Alexander Kinyua (Harford County Sheriff's Office)

In that assault case, Kinyua also pleaded guilty and was found not criminally responsible. A judge in December agreed with a psychiatric assessment that determined he was suffering from paranoid schizophrenia at the time and thought reptilian aliens were going to destroy Earth.

Officials released few specifics Monday about their assessment of his mental state at the time of the killing.

After the hearing, Harford County State’s Attorney Joseph I. Cassilly said that Maryland found he was not in control of his actions in the murder case and that he had no option but to accept that conclusion.

“We really had no evidence, no testimony or opinion from other medical personnel that would dispute the findings of the doctors” at Clifton T. Perkins Hospital, the state facility where Kinyua is being held, he said.

Agyei-Kodie’s loved ones felt “a great sense of emptiness” after Kinyua’s plea, Cassilly said.

“They kind of feel like nothing really happened today,” he said.

Cassilly said that under state law, a committed person cannot be released until the court finds that he or she is no longer a threat to himself or others, based on psychiatric evaluations. Assistant State’s Attorney Chris Smith added that he has seen defendants convicted of lesser charges, such as arsons and assaults, committed for more than 20 years.

Kinyua, bearded and wearing glasses, a black sweater and navy blue pants, answered Circuit Judge Stephen M. Waldron quietly as the judge asked whether he understood the terms of his plea.

Agyei-Kodie, a Ghanaian national who had pursued graduate studies in Maryland, had been staying with Kinyua’s family in Joppa for several months when he disappeared last May, prosecutors say.

Agyei-Kodie’s loved ones spoke in court Monday about the loss they had suffered. His mother and siblings live in Ghana.

Agyei-Kodie’s uncle, Anthony Opoku Ware, also described his nephew’s ambitions.

“He was very much into becoming somebody in life,” Ware said.

Agyei-Kodie had faced his own legal troubles.

In 2009, he was convicted in a case involving a Morgan State graduate student who told police that he harassed her.

His student visa was revoked in March 2010 and an immigration judge ordered him to be deported, a U.S. Immigration and Customs Enforcement spokeswoman said last year.