This paper develops and estimates a simple structural model of household decisions regarding child labor and schooling. We argue that part of the conflicting results from the previous literature related to the effect of improvements in economic conditions on child labor derives from the different income and substitution effects implicit in different types of income variation. Our model leads to an empirical specification where income and substitution effects can be clearly identified. We apply our model to Brazil and use agricultural shocks to local economic activity (coffee and overall agricultural production) to distinguish between the effects of increases in household income and increases in the opportunity cost of children's time. The results show that higher parental wages and household wealth are associated with lower child labor and higher school attendance. Nevertheless, conditional on family income and socioeconomic status, exogenous temporary increases in local economic activity are associated with increased opportunity cost of children's time and, therefore, higher child labor and lower schooling. The results reconcile economic theory with seemingly contradictory evidence from the previous empirical literature