BACKGROUND: The limited literature on mental illness in end-stage kidney disease (ESKD) patients suggests that this disease is common and burdensome but underrecognized in clinical practice. This study aimed to analyze the prevalence of mental illness in ESKD patients. METHODS: We assessed the prevalence and patterns of mental illnesses in a nationwide cohort of patients diagnosed with ESKD between January 1, 2008, and December 31, 2017. The risk of mental illness was evaluated using a multivariable Cox proportional hazards model. RESULTS: A total of 70,079 patients met all study inclusion criteria. A total of 28.3% of patients had mental illness, and the specific distribution was as follows: depression, 16.8%; anxiety, 20.0%; somatoform/conversion disorder, 0.9%; stress reaction/adjustment disorder, 2.5%; and substance abuse disorder, 0.6%. The frequency of mental illness was highest in patients on hemodialysis (HD), followed by patients on peritoneal dialysis (PD) and kidney transplant (KT) patients. The peak rate of mental illness in HD and PD patients was reached 1 to 2 years after renal replacement therapy initiation, but the peak rate of most mental illnesses in KT patients occurred before surgery. The prevalence of depression was 2.19 times higher in HD patients and 1.97 times higher in PD patients than in KT patients. CONCLUSION: ESKD patients are at high risk of mental illness, and the prevalence of mental illness is highest in HD patients. Since the onset of mental illness occurs around the initiation of renal replacement therapy, clinicians need to pay attention to mental illness when treating ESKD patients.