Many students start college intending to pursue a career in the biosciences, but too many abandon this goal because they struggle in introductory biology. Interventions have been developed to close achievement gaps for underrepresented minority students and women, but no prior research has attempted to close the gap for first-generation students, a population that accounts for nearly a fifth of college students. We report a values affirmation intervention conducted with 798 U.S. students (154 first-generation) in an introductory biology course for majors. For first-generation students, values affirmation significantly improved final course grades and retention in the second course in the biology sequence, as well as overall GPA for the semester. This brief intervention narrowed the achievement gap between first-generation and continuing generation students for course grades by 50% and increased retention in a critical gateway course by 20%. Our results suggest that educators can expand the pipeline for first-generation students to continue studying in the biosciences with psychological interventions.