Jack Marsters, 18, was arrested after the flare was discharged in Bo'ness Academy, West Lothian just before the start of the school day on 28 April.
Marsters' actions led to the entire 1,200-pupil, 90-teacher school being evacuated.
No damage was caused and no one was injured.
The flare set off the school's smoke alarm system, alerting the Scottish Fire and Rescue Service.
Marsters, of Bo'ness, pleaded guilty at Falkirk Sheriff Court to culpable and reckless conduct.
Sheriff John Mundy deferred sentence until 13 February and granted Marsters bail.
A teenager has admitted setting off a smoke flare and placing other pupils at risk of injury during his leaving day at secondary school.