A Manhattan teacher secretly videotaped colleagues and students in a gym office toilet stall — but won’t be fired, officials said.

Johnny Tang, a gym teacher and swim instructor at the Urban Assembly New York Harbor School, allegedly propped up his cell phone in his open locker facing the stall, says a report by the Special Commissioner of Investigation for city schools.

A female teacher using the toilet spotted the phone and realized it was “on record mode.”

She reviewed some of the 8- to-12 minute recording, which showed her “performing feminine hygiene,” and was so disgusted she deleted that part.

A girl student had used the toilet about two minutes earlier, she told probers.

The staffer confronted Tang, who took the phone, claimed he had put it on record mode “by mistake,” and deleted the tape.

The accused peeper, who makes $90,500 a year, was removed from the school and charged with misconduct. But the city Department of Education did not pursue termination, saying it was difficult because the evidence was destroyed. Instead, Tang agreed to pay a $25,000 fine.

The DOE said Tang was assigned “to a central office,” and won’t be working in schools.