It happened in the first-floor boys restroom at Sunnyside Intermediate School in Lafayette, Indiana on Friday.
The student managed to start a fire or enough smoke to set off the fire alarm, but investigators say someone grabbed a fire extinguisher and quickly put it out.
The fire was contained within the wall socket, according to Lafayette Fire Department Fire Inspector Todd Trent.
Because of his age, the boy’s identity will not be released.
He was accused of criminal recklessness and taken to the juvenile probation intake offices, police said.