The security scare in Beaver County, Pennsylvania, started when a receptionist called 19-year-old Ambridge Area High School student Travis Clawson to confirm an upcoming appointment with his eye doctor.
The call went to his voicemail, which featured him rapping along to the Will Smith song including the lyric: "Shooting some b-ball outside of the school."
The receptionist mistook the phrase for "shooting people outside of the school" and quickly alerted police, who advised all schools in the area to go on lockdown for 20 minutes while they searched for Clawson.
He was found in the guidance office of his high school, which was swarmed by officers who took him into custody. He then explained the misunderstanding.
James Mann, acting police chief in Ambridge, told Times Online: "I believe everyone acted appropriately. Our first concern is the safety of kids."
Clawson's father Wendell was less impressed, saying: "An innocent young man was embarrassed. How is he supposed to go back to school and face his classmates?"
The teenager was released without charge after being urged by officials to change the message on his voicemail.