(CNN) An Ohio high school is defending its decision to pepper spray a group of 11th grade students. It says it was a lesson in law enforcement and consequences.

The incident happened last week at Barberton High School in Barberton, about 40 miles south of Cleveland.

As part of a class in law and public safety, the instructor made the students line up against a wall and spritzed them one by one with a burst of pepper spray.

The school says the students volunteered for the activity -- and their parents OK'd it.

"Students were required to have parental permission and consent in order to participate in the voluntary exercise," said Barberton City School's superintendent Patricia Cleary.

Read More