Two blocks away, six students approached a 36-year-old man walking alone.
Three of them allegedly jumped the man and beat him badly enough to send him to the hospital.
The attack was caught on video surveillance that school administrators tracked down.
"When we found that there was footage we were able to identify at least one of the students and that led us to some other students and then we turned that information over to the police," Mastery CEO Scott Gordon said.
So-called flash mob violence has rocked the city in recent months.
Mayor Michael Nutter announced an intensive crackdown yesterday.
He's vowed that teenagers involved in the random attacks will go to jail.
That's what the three 8th and 9th graders from Mastery are now facing.
It's also a blow to a school with a sterling reputation for achievement.
Other students returned to the school today to meet with administrators and community leaders.
They were horrified to hear that some of their classmates have tainted their reputation.
"There're a lot of students here including myself who work very, very hard to make sure they'll have a great future, be successful. When something like this happens, it makes us all look bad," 10th grader Jazmine Smith said.
The Mastery students are now hatching a plan of action to spread the antiviolence message to teenagers across the city.
"There's no reason for people to act like this so we're trying to get it under control," 10th grader Ashley Peebles said.
The parents of the three suspects have been contacted and they're expected to turn the boys over to the police tomorrow morning.