This paper evaluates the effect of a free compulsory education reform in rural China on the incidence of child labor. We exploit the cross-province variation in the roll-out of the reform and apply a difference-in-differences strategy to identify the causal effects of the reform. We find that the exposure to the free compulsory education significantly reduces the incidence of child labor for boys, but has no significant effect on the likelihood of child labor for girls. Specifically, one additional semester of free compulsory education decreases the incidence of child labor for boys by 8.3 percentage points. Moreover, the negative effect of the reform on the likelihood of child labor is stronger for boys from households with lower socioeconomic status. Finally, the free compulsory education reform may induce parents to reallocate resources towards boys within a household and thus may enlarge the gender gap in human capital investment.