Not just prison, life imprisonment under the oversight of medical professionals, until he can be deemed to not be a danger to others.
From a security perspective, what he’s done is very impressive. It sounds like he has a lot of troubles, though, and if anything this act has probably pushed the authorities to give him the medical help he probably needed.