High-School human capital investment occurs within a competitive environment, and Affirmative Action (AA) shapes the relative competition between blacks and whites for admission to high-quality colleges. We present a theory of AA in university admissions and conduct a field experiment to mimic aspects of competition for college. We offer relative incentives to study math and track students’ time on a mathematics website. AA increases average human capital investment and exam performance for its target beneficiaries by mitigating “discouragement effects.” We also find evidence that AA can promote greater equality of market outcomes and narrow achievement gaps at the same time.