Two Harlem elementary-school administrators broke city rules by keeping difficult 10-year-olds out of class for months without instruction — and hid the excessive punishments from their superiors and parents, investigators found.

PS 92 Principal Rosa Davila and Assistant Principal Deborah Payne stuck challenging kids in the main office, in a room meant for short-term punishment, and in the back of younger kids’ classrooms for up to three months — even though the maximum punishment a principal can give is five days.

Davila said at least some of the “suspended” kids were pulled from their classes solely for “being disrespectful.”

Yet she admitted knowing they were punished — without receiving the required instruction — for months on end, according to a probe by the Department of Education’s Office of Special Investigations.

One fifth-grader who spent a whole month in the principal’s office and then two months in the back of a classroom for younger students said she asked Davila about her prolonged exile.

“You’re not going back to the classroom because you’re going to get into trouble again” was all the principal would tell her, according to the report.

Another student, who spent two weeks in the main office and two months in a so-called “SAVE” room intended for short disciplinary stays, said Payne made him follow her around the school while she performed her duties.

The kid — who claimed he didn’t know why he was being punished — said Payne would then visit the SAVE room and show him a list of trips other kids in his class were attending.

“Look at what you’re missing out on,” she told him, according to the report.

None of the four parents interviewed was told how long their kids were kept out of the classroom, and none of the punishments was documented in the city’s mandatory suspension reporting system, according to investigators.

One fifth-grader who spent three weeks in the principal’s office, two weeks in the SAVE room and one week in the back of a classroom complained about falling behind her classmates.

“I was just sitting around in the classroom all day, not doing anything,” she told investigators. “I was not being taught and didn’t receive any work.”

Davila, a 10th-year principal who earns $135,000 a year, did not respond to a request for comment, and a phone message left for Payne was not returned.

It took the DOE’s investigative unit, known as OSI, a lengthy 16 months to conclude its case against the administrators, and it took the DOE an additional eight months to reach a disciplinary deal with them.

More than two years after their actions, Davila was fined $7,500 and Payne was fined $5,000.