This paper uses exogenous variation in rainfall across districts in Uganda to estimate the causal effects of household income shocks on children's enrollment and cognitive skills conditional on gender. I find negative income shocks to have large negative and highly significant effects on female enrollment in primary schools and the effect grows stronger for older girls. The effect on boys' enrollment is smaller and only marginally significant. Moreover, I find that a negative income shock has an adverse effect on test scores in general and test scores of female students in particular. The results imply that households respond to income shocks by varying the quantity and quality of girls' education while boys are to a large extent sheltered -- a finding consistent with a model where parents' values of child labor differ across sexes.