In a 1-year randomized controlled trial involving thousands of university students, we provide real-time private feedback on relative performance in a semester-long online assignment. Within this setup, our experimental design cleanly identifies the behavioral response to rank incentives (i.e., the incentives stemming from an inherent preference for high rank). We find that rank incentives not only boost performance in the related assignment, but also increase the average grade across all course exams taken over the semester by 0.21 standard deviations. These beneficial effects remain sizeable across all quantiles and extend beyond the time of the intervention. The mechanism behind these findings involves social learning: rank incentives make students engage more in peer interactions, which lead them to perform significantly better across the board. Finally, we explore the virtues of real-time feedback by analyzing a number of alternative variations in the way it is provided.