A Brooklyn teacher whose accusations led to a massive 2004 grade-fixing probe is back at war with the Department of Education.

Phil Nobile is fighting to keep his teaching gig despite being cited in 2015 for harassing a former principal — a claim he denies, according to court papers.

Nobile made headlines more than a decade ago when he claimed administrators at Cobble Hill School of American Studies, where he worked at the time, were doctoring exam grades and passing undeserving students.

Amid a lengthy investigation, then-Assistant Principal Theresa Capra and Principal Lennel George were fired and the school’s reputation was left in tatters.

But a subsequent probe in 2007 by the Special Commissioner of Investigation found that the initial inquiry — led by infamous former NYPD Detective Louis Scarcella — was flawed and Nobile’s claims were meritless.

The SCI report exonerated Capra and George, asserting that Nobile manufactured the cheating claims because Capra gave him a bad review.

Soon after, Nobile was accused of corporal punishment and vengefully flunking students. He was assigned to a rubber room where he remained for four years before being placed in District 14 in Brooklyn as a substitute, according to court papers.

Nobile denied the charges against him and claimed he was targeted for his campaign to expose grade doctoring.

The DOE moved to fire Nobile last year, asserting in court papers that he was arrested in New Jersey for harassing Capra.

Nobile told The Post Thursday that the harassment consisted of him including Capra on an e-mail chain related to the cheating accusations and that he was never arrested.

“She decided to bring that e-mail to the police,” he said, adding that she filed a complaint.

Our editors found this article on this site using Google and regenerated it for our readers.