This paper shows that the gender of politicians affects the educational levels of individuals who grow up in the districts where these politicians are elected. Increasing female political representation by 10 percentage points increases the probability that an individual attains primary education in urban areas by 6 percentage points, which is 21% of the difference in primary education attainment between the richest and the poorest Indian states. Caste also matters, as female politicians who won seats reserved for lower castes and disadvantaged tribes are those who mainly have an effect. In addition, both the gender and caste of politicians determine who benefits more from their policies: in urban areas female politicians increase educational achievements of those of their gender and caste. A unique dataset collected on politicians in India is matched with individual data by cohort and district of residence. The political data allow the identification of close elections between women and men, which yield quasi-experimental election outcomes used to estimate the causal effect of the gender of politicians.