At present, the probability of criminal cases in our country is on the rise, which has a great relationship with the lack of mental health intervention. Therefore, the use of ideological and political education for students' mental health intervention and evaluation was proposed. In this paper, the concept and function of mental health education and ideological and political education were expounded in detail, and then a two-month experiment on ideological and political education was carried out in 2016 freshmen of S University. Experiments were carried out by using experiments such as Patient Health Questionnaire-9 (PHQ-9), Generalized Anxiety Disorder-7 (GAD-7), Self-Rated Health Measurement Scale (SRHMS), mini version international psychiatric interview (M.I.N.I), Self-Rating Anxiety Scale (SAS), Self-Rating Depression Scale (SDS) and Irrational Beliefs Scale (IBS). Before and after the intervention of SDS, the total score of intervention group were significantly different from control group (t=3.84, P<0.05; t=-3.26, P<0.05). Before and after the intervention of IBS, there was no significant difference between the total score of the intervention group and the control group. (t=1.86, P>0.05; t=0.20, P>0.05). The intervention of Ideological and political education has an effect on students' depression.