OAKLAND — An Alameda man who killed seven and wounded three in a shooting rampage at a small Oakland nursing college in 2012 will spend the rest of his life in prison under a plea deal reached Tuesday after prosecutors promised not to seek the death penalty.

One L. Goh, 48, pleaded no contest to his full 10-count mass murder indictment, less than two weeks after he was declared competent to stand trial for the April 2, 2012, Oikos University massacre. Goh had been considered mentally incompetent for prosecution for much of the five years since the massacre, and his prosecution was put on hold indefinitely in 2015.

His improved mental health status and the Alameda County District Attorney’s Office’s announcement not to seek the death penalty gave Goh, who is hospitalized at Napa State Hospital, a path to plead no contest, according to assistant public defender Dave Klaus. He will be sentenced by Judge Jeffrey Horner on July 14 to seven consecutive sentences of life in prison without the possibility of parole.

“He did not want to seek a not guilty by reason of insanity or any other mental defense,” Klaus said. “Partly, because he doesn’t believe he is mentally ill in any way, and partly because he didn’t want to seem like he was trying to avoid responsibility for what he had done.”

Goh is a diagnosed paranoid schizophrenic whose delusions led him to believe that the administration and staff at Oikos University were conspiring against him, alienating him from his fellow classmates, and covertly having him bugged and followed. He was considered a good student before he dropped out of the school’s nursing program.

Goh told police he went to the Oikos campus in East Oakland that day to confront a specific administrator and, if she didn’t refund him the $6,000 he believed he was due, he was going to kill her and himself. When Goh discovered the administrator wasn’t on campus, he kidnapped university receptionist Katleen Ping, 24, at gunpoint and brought her to the classroom occupied by his former teacher and classmates.

Ping was killed in the shooting, along with students Doris Chibuko, 42; Lydia Sim, 21; Grace Kim, 23; Judith Seymour, 53; Sonam Choedon, 33; and Tshering Bhutia, 38. Three others survived gunshot wounds. The special allegation of multiple murders, and that Ping was killed in the course of a kidnapping, made Goh eligible for the death penalty.

He shot them with a 45-caliber semi-automatic handgun that he legally purchased in Alameda County a few months prior, having no formal record of mental illness despite exhibiting symptoms of schizophrenia for more than a decade. Goh was arrested shortly afterward in the parking lot of an Alameda Safeway.

“He turned himself in and immediately confessed to police and was extremely remorseful, as much to the extent that he wanted to die,” Klaus said. “For a long time, he wanted to receive the death penalty in this case, and that was, in some part, an expression of his deep remorse.

“He specifically wanted me to tell the public, and especially the families and survivors, that he is deeply, deeply sorry for what happened,” Klaus said.

Goh sat stoically in court Tuesday, giving short yes-and-no answers to the judge’s questions through a Korean interpreter. He did not make any statements.

Four people related to victims of the massacre watched Goh’s change-of-plea hearing, but they declined to comment afterward.

District Attorney Nancy O’Malley said the plea gives families, survivors and first responders finality after five years of uncertainty.

“The enormity and devastation of this mass shooting remains unprecedented in Alameda County,” O’Malley said in a news release. “With the conclusion of this case, we know that One Goh will never again be in the position to harm any member of our community.”