In California, Penal Code 2970 allows for the involuntary commitment of certain individuals classified as Mentally Disordered Offenders (MDOs) after they complete their prison sentence. To qualify, the person must have a severe mental disorder linked to a violent offense and be deemed a continuing danger to others if not treated. Before their release, the state can petition to extend their confinement in a mental health facility for one year, subject to a court hearing or jury trial. These commitments can be renewed annually if the person still meets the legal criteria. The goal is to ensure both public safety and that the individual receives necessary mental health treatment.