We study the importance of teacher subject knowledge for student performance in Sub-Saharan Africa using unique international assessment data for sixth-grade students and their teachers. To circumvent bias due to unobserved student heterogeneity, we exploit variation within students across math and reading. Teacher subject knowledge has a modest impact on student performance. Exploiting vast cross-country differences in economic development, we find that teacher knowledge is effective only in more developed African countries. Results are robust to adding teacher fixed effects and accounting for potential sorting based on subject-specific factors.