Background Prolonged forensic psychiatric hospitalizations have raised ethical, economic, and clinical concerns. Due to the confounded nature of factors affecting length of stay of psychiatric offender patients, prior research has called for the application of a new statistical methodology better accommodating this data structure. The present study seeks to examine factors responsible for prolonged detentions of schizophrenic offenders referred to a Swiss forensic hospital using machine learning algorithms more apt to reveal non-linear interdependencies between variables.Methods In this retrospective file and registry study, multidisciplinary notes of 143 schizophrenic delinquents were reviewed by using a structured protocol on patients’ characteristics, criminal and medical history and course of treatment. Via a forward selection procedure, the most influential predictors for length of stay were preselected. Machine learning algorithms identified the most efficient model for predicting length-of-stay.Results/ Conclusions Ten factors prolonging forensic hospitalization were identified: Six were related to aspects of the index offence (index offence, number of crimes, extend of injury to the victim of the offence), two were related to psychopathology at admission or even prior to that (hallucinations in psychiatric history), one alluded to the course of therapy (self-harming during inpatient treatment), and one referred to biographical aspects (poverty during childhood/ adolescence). Results are discussed in light of earlier reports on the subject.