Human capital investment is usually modeled in an intertemporal optimization framework in which households or individuals maximize the present value of life-time utility. The main cost emphasized in these models is forgone earnings while in school. Direct costs such as user fees and travel costs are given much less attention. In many developing countries, however, direct costs such as travel expenses can be an important component in household educational decisions. If the direct cost of enrollment in middle or secondary schools is much higher than for primary schools, the households reduce investment in primary education. The paper introduces into the Ben-Porath/Heckman model a convex cost function of schooling, and analyzes the implications for school attendance and attainment. The empirical work confirms the prediction of the theoretical model: the cost of advanced levels of education influences primary schooling decisions. This finding is relevant for current policy debates concerning the financing of educational systems in developing countries.