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.
Inkster police told The Associated Press that they couldn't release any information about the incident.
Inkster is about 15 miles west of Detroit.