Background. Substance use is prevalent among patients with mental illness in low- and middle-income countries, including Tanzania. This heightened prevalence not only increases the risk of developing mental disorders and substance use disorders but also contributes to poor treatment outcomes for these patients. Despite these concerns, the current prevalence of substance use and its associated factors in this population remains unclear in Tanzania. Therefore, this study is aimed at determining the 12-month period prevalence of self-reported substance use and associated factors among patients with mental illness. Methods. We conducted a cross-sectional analytical study among patients with mental illness at Muhimbili National Hospital in Dar es Salaam, Tanzania. Respondents were selected using a systematic random sampling technique. Data on self-reported substance use were collected using the World Health Organization’s (WHO) alcohol, smoking, and substance involvement screening test (ASSIST) V3.0. IBM SPSS version 25 was employed for data analysis, utilizing frequencies and percentages to determine the prevalence of self-reported substance use. The study employed bivariate and multiple logistic regression analyses to investigate the association between patient characteristics and self-reported substance use, with statistical significance set at a p value of < 0.05. Results. A total of 364 patients were enrolled in the study, with 215 (59.1%) being male and a mean (SD) age of 35.57 (±9.01) years. Among the participants, 119 (32.7%) reported substance use. The most commonly used substances were alcohol (21.7%), tobacco (19.8%), and cannabis (12.9%). Factors significantly associated with self-reported substance use included younger age (AOR: 1.829; 95% CI: 1.112, 3.010; p=0.017), male gender (AOR: 2.346; 95% CI: 1.397, 3.939; p=0.001), positive family history of mental illness (AOR: 2.247; 95% CI: 1.364, 3.701; p=0.001), and a family history of substance use (AOR: 3.804; 95% CI: 2.305, 6.276; p<0.001). Conclusions. A significant proportion, amounting to one-third of patients, reported substance use, highlighting the imperative need for targeted measures within this population. The implementation of routine substance use screening programs for patients with mental illness is crucial, alongside gender-sensitive and age-specific interventions. Consideration of patients’ family history of mental illness and substance use should be an integral part of these measures.