This article structures a legal analysis on the release of detainees on humanitarian or medical grounds. Based on principles and standards applicable to deprivation of liberty, as well as legal instruments and jurisprudence from the Inter-American System of Human Rights, it underlines that states´ margin of maneuver for regulating this type of releases is not unlimited. Aside from covering persons with chronic, degenerative and terminal diseases, it highlights that release mechanisms should integrate a prevention approach in relation to detainees with risks of health complications, limiting in that manner, the imposition of unlawful pain and suffering by criminal and prison system. The foregoing becomes more relevant in the face of overcrowding in detention, absence or deficiency of health services and public health emergencies such as the one caused by the COVID-19 pandemic.