Barrington High School earned Friday's visit as a reward for winning the singer's "Shine Bright Like a Diamond" video contest.
The five-minute, student-produced video highlighted the school's volunteer and community service programs.
The Chicago Sun-Times reports that the singer told students she admired their passion and volunteerism.
Rihanna showed up more than five hours late, but some in the crowd said she was worth the wait.
She also posed for photos before heading off to her Friday night concert at Chicago's United Center.
Barrington freshman Nisha Ali says "the fact that she came here and thanked us was a huge deal."