Objectives: To describe and correlate the epidemiological, clinical and legal characteristics of persons exempt from criminal liability registered in the National Prison Institute of Peru in the period 2014-2019. Material and method: Retrospective, cross-sectional descriptive study with correlational components and secondary sources. The sample consisted of all the persons exempt from criminal liability who formed part of the prison population of Peru during the study period. A validated data collection sheet was used. Data were analyzed through descriptive statistics using SPSS v24 software. For inferential analysis, a simple binary logistic regression was carried out. Results: A total of 179 persons exempt from criminal liability were identified in 36 Peruvian prisons; 94.4% were males, with an average age of 35 years; 6.1% were undocumented. 67.0% had a diagnosis of the schizophrenia spectrum. The main crimes were against freedom (39.1%) and against life, body and health (36.8%). In 74.6% of cases, the duration of involuntary commitment was more than five years; 11.5% remained in prison after the date of release. In 18.4%, involuntary commitment was established by the Peruvian National Prison Institute. Associations between variables such as diagnosis, type and severity of the crime were found. Discussion: Aspects that violate national and international regulations (excessive length of involuntary commitment, in unsuitable locations, unjustified imprisonment, etc.) were identified, affecting the fundamental human rights of persons exempt from criminal liability in prison.