<strong>Introduction</strong>
We know little about the prevalence and patterns of substance use during incarceration, and we know even less about comparative substance use patterns by gender. To address these gaps in the literature, this study used latent class analysis (LCA) to identify substance use subgroups of incarcerated men (n = 1118) and women (n = 207).

<strong>Methods</strong>
The study drew data from six prisons in Spain. Participants completed a self-administered questionnaire with items probing for types of drugs used in the past three months, depression, anxiety, stress symptoms, aggressiveness, and perceived social support.

<strong>Results</strong>
Substance use was common among incarcerated men and women, with tobacco, cannabis, and sedatives being most prevalent. LCA revealed different patterns of substance use by gender. Four- and two-class solutions best fitted the data for men and women, respectively. Aggressiveness and depression were associated with high depressant use membership for men. Among women, aggressiveness and anxiety symptoms were positively associated with high polydrug use membership.

<strong>Conclusions</strong>
The prevalent and patterned use of substances inside Spanish prisons and their association with aggressiveness and depression elevates the risk of harm during incarceration. In the interest of safety and wellness, correctional behavioral health services should include and expand the availability of gender-specific integrated mental health and substance use interventions that address maladaptive behaviors such as aggression.