Nikolas Cruz. (Amy Beth Bennett/South Florida Sun-Sentinel/AP)

EACH NEW detail about the accused Marjory Stoneman Douglas High School gunman makes more apparent that Nikolas Cruz suffered from mental illness. Each new detail — the latest being the recommendation for his involuntary commitment two years before the mass shooting — makes clearer the extent and seriousness of his illness. And each new detail further calls into question the decision of a Florida prosecutor to seek the death penalty in what promises to be a costly and agonizing trial rather than accept a guilty plea that would put a sick young man away for the rest of his life.

Less than a month after the Parkland, Fla., rampage killed 17 people, Michael J. Satz, the Broward County state attorney, announced plans to seek execution of the 19-year-old suspect. He had earlier called the Feb. 14 mass shooting “the type of case the death penalty was designed for” and in a court filing he called the crime “especially heinous, atrocious or cruel.”

The horror of that day is without dispute. So, too, is the need for serious legal consequences. The gunman — and Mr. Cruz’s lawyers don’t dispute his guilt — must never again be in a position to be able to harm others. But will killing him serve justice? Even proponents of the death penalty (which we decidedly are not) are hard-pressed to justify its use on those who suffer from mental illness.

Mr. Cruz’s life was replete with behavioral and mental-health issues. According to medical records, his mother (since deceased) said he had been diagnosed with attention-deficit/hyperactivity disorder, autism and obsessive-compulsive disorder. It was recommended he be sent to a residential treatment facility in 2013; in 2016, after he made threats to himself and others, school officials considered but did not pursue involuntary commitment. It was one of many missed opportunities by government agencies alerted to his antisocial tendencies.

It probably will take three years before the start of the trial, which would be just one step in an arduous legal process that would cost millions of dollars. In the event of a death-penalty sentence, there would be lengthy appeals, with Mr. Cruz at the center of attention. Would that benefit the victims and their families? How would that help the community? Wouldn’t the time and money be better spent fixing the systems that failed Mr. Cruz and his victims?

Mr. Satz should revisit his decision and accept a guilty plea, which would be the last thing heard from Mr. Cruz.