PISCATAWAY, N.J. – A former New Jersey teacher and coach who was fired for having sex with a student is claiming prosecutors are pursuing criminal charges because he’s a black man.

Piscataway High School physical education teacher and girl’s soccer coach Adrian McConney, 39, was arrested and charged with official misconduct in 2013 when school officials realized he was engaged in a sexual relationship with an 18-year-old student, NJ.com reports.

MORE NEWS: Know These Before Moving From Cyprus To The UK

The case was dismissed by Superior Court Judge Bradley Ferencz in 2014 because the student was an adult, but Middlesex County Prosecutor appealed the decision to the Appellate Division, which overturned the ruling last July, according to My Central Jersey.

“Carey said the Appellate Division reversed the trail court’s decision, and reinstated the indictment, holding ‘evidence of an unauthorized act can consist of a criminal act, violation of a specific policy, or a violation of a duty inherent to an official’s position,” the news site reports.

The court noted that “teachers stand as surrogate parents during the day (and should be) educating, not endangering, and protecting, not exploiting vulnerable children,” Carey said.

Now, McConney’s attorney, Timothy Smith, is trying another tactic and alleging his client is the target of prosecution because he’s a black man, not because he took advantage of his student for sex.

“The government’s insistence, in this instance, that Mr. McConney’s charge not be resolved in any fashion short of his incarceration, is unprecedented, and entirely based on his status as a black male,” Smith told NJ.com in a statement.

Carey think the claim is a load of baloney.

“To state that this case is being prosecuted based on the defendant’s race and gender is both inaccurate and highly offensive,” he said.

MORE NEWS: How to prepare for face-to-face classes

[xyz-ihs snippet=”NEW-In-Article-Rev-Content-Widget”]

Regardless, Smith is comparing McConney’s case to another one of his clients in a similar circumstance that received a more lenient punishment. Mendham High School teacher Nicole McDonough admitted to having sex on multiple occasions with an 18-year-old student and was admitted to a pre-trial intervention program that will erase criminal charges pending against her if completed, Smith said.

McDonough, 33, is a white female teacher.

NJ.com reports:

If McDonough successfully completes the PTI program, the second-degree misconduct charge and other misconduct charges will effectively be dismissed. Violation of the PTI program, however, would send the case back to sentencing where McDonough could face up to 10 years in prison and a $150,000 fine.

Prosecutors initially sought a five-year prison term for McDonough’s crimes, according to the site.

Smith told My Central Jersey after the case was reinstated last summer that he was “evaluating all options at our disposal to address this injustice.”

“On appeal, the government employed the unscrupulous tactic of relying upon facts and evidence outside the scope of the grand jury presentation, the sufficiency of which was the sole subject of the appeal,” Smith said at the time.

“It is a sad day for justice when such a repugnant strategy is condoned. The extent to which our government will play fast and loose with the facts, when an individual’s freedom is at stake, is shocking,” he continued.

“This is especially true considering the theory of the government’s case, which is that public employees should be exposed to up to ten years hard prison time, with five years of mandatory parole ineligibility, for violating any provision within their own union’s code of general conduct, even when it expressly exempts its members from such exposure.”

Carey, of course, believes the appeals ruling was the right call, and claims state law is clear on public officials abusing their position.

“A teacher had sex with a public school student,” he told NJ.com in August 2015. “This conduct, as determined by our Legislature, is illegal.”

McConney’s trial is set to begin January 24.