In this study, we investigate the impacts of the 2002 elimination of primary school fees in Mainland Tanzania. We explore how the magnitude of these effects depends on gender and the size of early investments in the educational infrastructure of Tanganyika. We use the 2002 and 2012 census waves as well as historical information on the location of schools in the late 1940s, and conduct a difference-in-differences analysis. We find that exposure to an average of 1.7 years of free primary education has reduced the proportion of people who have never attended primary education by 6.8 percentage points. The benefits of fee removal have been significantly larger for females compared to males, and females from districts where the size of investments in education was relatively larger during colonial rule have been the greatest beneficiaries.