School resource Deputy Pedro Colon received an alert that a student was having a medical emergency during lunch and rushed to his aid.
Body camera footage of the incident shows the student face down seizing on the ground.
The deputy immediately began performing CPR on the student and after several minutes, the student was alert and sitting up.
"Deputy Colon's quick call to action was heroic, and had it not been for his efforts, we might be looking at a very different situation today," Sheriff Chad Chronister said in a statement. "This incident goes to show the importance of the CPR training all of our deputies receive. It's a prime example of being ready to serve when called upon."
Once the student returned to school, he met the deputy and thanked him in person.
Colon has worked for the sheriff's office since 2003 and has been a school resource officer for more than a decade.