Thomas Tramaglini – the so-called pooperintendent who was busted defecating on a school track and field complex – finally fessed up to his dirty deed, though he’s blaming the situation on an inability to control his bowels.

Tramaglini, 42, was superintendent of the Kenilworth, New Jersey school district when a resource officer at Homdel High School set up surveillance to nab a serial pooper who was leaving special surprises behind “on a daily basis,” police said.

The officer told police Tramaglini was caught on surveillance defecating at the school, where he was running on the track before the school day. Police charged Tramaglini on May 1 with public defecation, littering and lewdness. Tramaglini resigned his $147,504-per-year position in July, though he continued to collect a check until September. The district paid Tramaglini more than $61,000 while on leave, as well as another $48,000 in payouts for unused vacation and early termination as part of a separation agreement, The Asbury Park Press reports.

On Wednesday, Tramaglini finally confessed to his crime, though his attorney blamed the ordeal on a case of “runner’s diarrhea” and pushed back against claims it was a regular occurrence.

Attorney Matthew Adams told the court the former superintendent has seen a doctor for his medical condition, which is allegedly instigated by acute blood flow during exercise. Tramaglini lived three miles from the school, and news reports showed three portable toilets just steps from the scene of the crime, but Adams contends Tramaglini was in dire straits, reports.

The superintendent didn’t realize the portable toilets were nearby, Adams said, and he “was not certain he would have made it even if he did (know they existed).”

Instead, Tramaglini copped a squat under the bleachers, then cleaned up his mess, according to Adams.

“There’s no evidence he was ever a serial offender,” Adams said. “We were ready to go to trial on some of the allegations about certain dates with GPS evidence from his Garmin running watch. That story needs to be told. So much went on today (in court) that flies in the face of everything, unfortunately, he’s been through. He’s been through hell and back. He deserves a story that tells the accurate picture.”

Tramaglini pleaded guilty to a single count of public defecation, and the other two charges were dropped. He was ordered to pay a $500 fine, plus court costs and fees.

In court, Tramaglini testified that he decided to poop under the bleachers because he felt an “immediate or urgent need to defecate while running.”

The former superintendent in now suing township police for releasing his mugshot and details about his arrest, which Adams said are really embarrassing and ruined his reputation.

“This case has dragged on for a long time. It has been the subject of what I would submit is unfair media publicity and it has cost my client Mr. Tramaglini dearly,” Adams told the court. “This case is a far cry from the unthinkable nicknames that have been plastered worldwide about my client.”

Several news outlets have referred to Tramaglini as the pooperintendent, or super pooper.