The Detroit student was stopped when he walked in the door.
School district spokeswoman Val Hughes says the principal at Daly Elementary School in Inkster was tipped by a phone call before school started on Friday morning.
She says the principal met the boy at the school’s entrance. The boy and weapon were removed from school grounds around 9 a.m.
Hughes says no one was harmed and that other students weren’t aware of what happened.
No details were released about how the boy got the gun or why he took it to school.