Background: Medical comorbidity is associated with worse psychiatric outcomes, reduced functioning and higher services use, including inpatient psychiatric care. Aim: We explored the relation between medical comorbidity and length of stay, adjusting for potential confounders. Methods: We retrospectively analyzed an administrative database comprising all inpatient admissions between 2005 and 2014 at the Department of Psychiatry and Mental Health at Vila Nova de Gaia/Espinho Healthcare Center, Vila Nova de Gaia - Portugal. Psychiatric diagnosis and medical comorbidity were coded according to single-level and multi-level classification schemes, respectively, as proposed by the Clinical Classification Software. Results: We included a total of 4613 psychiatric inpatient admissions. The prevalence of medical comorbidity was 25.4% and it was associated with an average increase of 3.5 days (p < 0.001) in length of stay, comparing to patients without medical comorbidity. After adjusting for potential confounders, such as age, sex and year of discharge, medical comorbidity was associated with a 13% increase in length of stay. Conclusions: Medical comorbidity has measurable effects in inpatient outcomes, such as the length of stay and should be a major focus for intervention, in ambulatory care but also during psychiatric hospitalization.