Objective The objective was to analyze the moderating effect of self-esteem on the relationship between mental health difficulties and suicidal behavior in adolescence. Method The sample was composed of 1,790 Spanish adolescents (M = 15.70 years; SD = 1.26; 53.7% girls) through a stratified random sampling by cluster at classroom level. The participants completed questionnaires about emotional symptoms, behavioral problems, peer relationship difficulties, hyperactivity, suicidal behavior, and self-esteem. Results The results evidenced gender differences, showing that girls tend to have more emotional symptoms (t = −15.27; p ≤ .001; d = −0.71), more difficulties in peer relationship (t=−2.49; p = .013; d = −0.12) and less self-esteem (t = 12.15; p ≤ .001; d = 0.57), as well as more suicidal behaviors (t = −5.36; p ≤ .001; d = −0.25) than boys. It is also noted that emotional and behavioral difficulties influence suicidal behavior (R2 = 0.35; ΔF = 197.42; p ≤ .001). In addition, self-esteem appeared to act as a protective factor, buffering the relationship between emotional and behavioral problems and suicidal behavior (R2 = 0.39; F = 376.92; p ≤ .001). Conclusions Adolescents who present mental health difficulties might commit suicidal behavior if they have an unfavorable attitude toward themselves. However, the risk of committing suicidal behavior decreases if their attitude toward themselves is favorable. Thus, the development of self-esteem may be included in intervention programs for the prevention of suicidal behavior.