Objectives This study aims to explore the prevalence of depression and anxiety in left-behind children, and to identify patterns of parents' migration and relative factors associated with depression and anxiety risk in this population. Setting A cross-sectional survey using a school-based sample was conducted in Puyang, Hebei, North China in December 2012. Participants 2283 students aged 10-18years. Main outcome measures Parental migration status, depression and anxiety disorder. Results 61.2% of participants were left-behind children. The prevalence rate of depression among left-behind children with both parents migrating (14.2%) was higher than that of children with one parent migrating (11.7%) and no parent migrating (12.6%). The prevalence rate of anxiety disorder for children with no parent migrating (25.1%) was higher than that for children living with one or neither parent (22.2% and 22.0%). The risk factors for depression were low-level social support (OR=3.46, 95% CI 2.00 to 6.01), average academic performance (OR=2.37, 95% CI 1.7 to 3.3) and low academic performance (OR=3.01, 95% CI 1.92 to 4.72), staying up late (OR=1.67, 95% CI 1.17 to 2.39), having difficulty falling asleep (OR=2.04, 95% CI 1.48 to 2.82) and being an only child (OR=1.73, 95% CI 1.04 to 2.89). The factors associated with anxiety disorder were being female (OR=2.09, 95% CI 1.64 to 2.66), being in high school (OR=1.8, 95% CI 1.38 to 2.36), physical abuse (OR=1.5, 95% CI 1.04 to 2.15), having difficulty falling asleep (OR=1.67, 95% CI 1.33 to 2.10) and low-level social support (OR=2.17, 95% CI 1.44 to 3.28) and middle-level social support (OR=1.82, 95% CI 1.3 to 2.56). Conclusions Parents' migration was not associated with depression and anxiety in rural children aged 10-18years, but academic performance at school, sleep problems and lack of social support were associated with depression and anxiety.