A security guard at the Far South Side school on 112th and South Wallace made the discovery.
Antoine Rogers, 16, is charged with unlawful use of a weapon on school grounds.
Officials say they found an unloaded .22-caliber gun in his backpack after Rogers hesitated when he was asked to walk through a security gate a second time.