The incident was reported at 8:52 a.m. at the International Studies Academy at 655 De Haro St., where the student had allegedly brought the stun gun to the campus, police spokesman Sgt. Dennis Toomer said.
A male student saw the device, was interested and wanted to see it, prompting a tussle between the two, Toomer said.
Toomer said the male student was zapped on the wrist by the stun gun, which San Francisco Unified School District officials said was a Taser.
Medics were called but the boy did not appear to be injured. He was released at the scene and taken home by his mother, Toomer said.
Toomer said investigators were talking this morning to the female student, who school officials said will face appropriate disciplinary action.
The incident comes a day after the school, which serves students in grades six through 12, went into lockdown briefly because of a report of a student with a gun.
That student, a 14-year-old eighth-grader, ran away after school staff detained him and asked him to empty his pockets, police said.
The boy was found outside the school about 10 minutes later, and a gun was found near the campus, according to police.