Debbie does grade school.

An auditorium full of unsuspecting Brooklyn students — some as young as 5 years old — got a surprise lesson in reading, writing and raunchiness on May 29 when hard-core porn was accidentally screened at PS 17 in Williamsburg.

The kindergartners, first-graders and fifth-graders were exposed to a topless woman and sex acts in the 45 seconds the obscene clip played on the jumbo screen — as shocked teachers screamed, “Don’t look at it!” and frantically tried to turn it off.

Finally, one horrified teacher ripped the DVD player’s plug out of the wall to silence the smut.

“My son told his friend he saw a naked lady at school,” fumed Rona Easton, whose 6-year-old son, Cass, viewed the stunning reel with his kindergarten class. “I thought he was just being silly. It’s appalling.”

“My daughter is 6 years old; she doesn’t need to see that,” said another angry parent whose daughter is also in kindergarten. “I don’t even like to kiss in front of her because I think she’s too young. So I’m very angry.”

The five classes were in the auditorium for a “film festival,” and were supposed to watch “Camp Rock,” a Disney Channel movie starring the Jonas Brothers, according to a letter Principal Robert A. Marchi sent home to parents the day of the incident.

A teacher powered up the DVD player, then walked away to get the G-rated disc.

But the decidedly un-Disney skin flick was already loaded into the machine — and began to play.

“A very explicit pornographic video came on the screen,” Marchi wrote. “This was extremely upsetting to the students and staff members in attendance . . . I am deeply sorry that this episode took place at PS 17. I know that we will make every effort to find out who was responsible for this despicable act.”

Parents first heard the DVD player had been locked in the principal’s office before the impromptu X-rated screening but were later told it was moved to another office where anyone could have accessed it.

angela.montefinise@nypost.com