Self-compassion (SC) and its influence on mental health have always been a significant focus in psychological research, especially given the alarming prevalence of depression among Chinese university students. The purpose of this study is to examine the relationship between SC, encompassing both self-warmth and self-coldness, and depression among Chinese undergraduates, with emotion regulation strategies (ERS) serving as a mediator. The sample comprised 21,353 undergraduates from Yunnan Province, China, with data collected at two time points (T1 and T2). SC was measured using the Self-Compassion Scale-Short Form (SCS-SF), while depression was assessed with the Beck Depression Inventory (BDI). ERS were measured using the Cognitive Emotion Regulation Questionnaire-short (CERQ-short). Data were analyzed using structural equation modeling. Results demonstrated that the model of self-warmth, self-coldness, ERS, and depression fit the data well. Upon controlling for depression at T1, both self-warmth and self-coldness were significant predictors of depression through ERS. ERS were found to be a significant mediator in this study. The results indicated that self-warmth enhances adaptive ERS and reduces maladaptive ERS, leading to lower levels of depression, while self-coldness has the opposite influence.