We aimed to investigate the association between a diagnosis of untreated unruptured intracranial aneurysms (UIAs) and the development of mental illness. This retrospective, propensity-score-matched cohort study was based on the nationwide South Korean database. The UIA diagnosis group included participants newly diagnosed with UIA between 2011 and 2019. For a well-matched control group, patients diagnosed with an acute upper respiratory infection but without UIA during the same period were selected through 1:4 matching based on propensity scores, which were calculated using age, sex, economic status, and comorbidities. The study's outcome measure encompassed the incidence of mental illnesses over a 10-year period, using International Classification of Diseases-Tenth Revision codes for anxiety, stress, depressive, bipolar, and eating disorders, insomnia, and alcohol or drug misuse. After propensity score matching, 85 438 participants with untreated UIAs (50.75% male; average age, 56.41 [±13.82] years; follow-up, 4.21 [±2.56] years) and 331 123 controls (49.44% males; average age, 56.69 [±12.92] years; follow-up, 7.48 [±2.12] years) were compared. Incidence rate of mental illness was higher in the UIA group (113.07 versus 90.41 per 1000 person-years; hazard ratio, 1.104 [95% CI, 1.089-1.119]). The risk of mental illness varied slightly by sex (males: hazard ratio, 1.131 [95% CI, 1.108-1.155]; females: hazard ratio, 1.082 [95% CI, 1.063-1.103]). Hazard ratios showed a U-shaped relationship with age, peaking in younger age groups, decreasing in middle-aged groups, and slightly increasing in older age groups, especially in patients with severe mental illness receiving psychotherapy. Our findings indicate a higher risk of mental illness in patients with UIA diagnosis in specific demographic groups, suggesting a possible psychological burden associated with UIAs. Clinicians treating cerebral aneurysms should be aware that the psychological burden caused by the diagnosis of UIA itself could contribute to mental illness and strive to provide comprehensive care for these patients.