Objectives Infectious disease knowledge and behaviors are key elements that ensure student health and safety. This study explores the impact of health education on student knowledge and behaviors toward infectious diseases and determines the factors affecting infectious diseases knowledge and behaviors among students in Gansu, China. Methods A cross-sectional study and three sampling methods were used in two counties, 12 schools, and 32 classes in Gansu, China, from 2012 to 2013. Collected data included the following: (1) sociodemographic characteristics of 2002 students (1001 participants in the intervention group and 1001 in the control group); (2) accuracy of student knowledge and behaviors toward infectious diseases based on comparison of intervention and control groups through X2 test; and (3) mean scores on knowledge and behavior of students with different characteristics toward infectious diseases, as analyzed through analysis of variance (ANOVA). Multiple linear regression was conducted to analyze factors affecting student knowledge and behaviors toward infectious diseases. Results Statistically significant differences were observed among eight items of infectious disease transmission and treatment knowledge between intervention and control groups (P < 0.001). Average accuracies of knowledge and behaviors toward infectious diseases reached 72.23% and 60.03%. Significant differences were observed in six items on student behavior in rural and urban areas (P < 0.001). Health education, household register, and county affected scores of student knowledge and behaviors toward infectious diseases (P < 0.05). Gender and education level also affected scores of student behaviors toward infectious diseases (P < 0.001). Conclusions Health education contributes to student knowledge and behaviors toward infectious diseases. Students in the control group need intensified health education on infectious diseases. Health education needs to pay particular attention to rural students, all male students, and students at senior high school level living on campus.