A high-ranking New York Police Department official accused of posting hateful messages online has opted to retire days after the department said it was suspending him without pay.

Deputy Inspector James Kobel, the former head of the department’s workplace discrimination office, has submitted retirement papers, an NYPD spokesperson confirmed Monday.

The NYPD opened an internal affairs investigation into the 50-year-old in November after he was accused of posting attacks on Black and Jewish people, women and members of the LGBTQ community on a message board where officers would air grievances anonymously.

NYPD INVESTIGATING OFFICER'S POTENTIAL CAPITOL RIOT INVOLVEMENT 

Kobel was removed as commanding officer of the Equal Employment Opportunity Division and reassigned to the transit unit. Last week, the department placed him on unpaid administrative leave.

He was accused of posting for more than a year to an online message board called the Rant using the pseudonym "Clouseau," a reference to the bumbling French detective in the "Pink Panther" films.

"Clouseau" used vulgar, racist nicknames when referring to multiple Black public figures, including Bronx District Attorney Darcel Clark, former President Barack Obama and Mayor Bill de Blasio’s son. He also ridiculed Public Advocate Jumaane Williams for having Tourette’s syndrome.

"That is a drastic step, but we thought it was the appropriate step due to the nature of his given assignment as well as the allegations and what we have learned thus far," NYPD commissioner, Dermot F. Shea, told reporters. 

He added that the posts by "Clouseau" were "utterly disgusting."

In a tweet on Sunday, de Blasio said the posts were "absolutely disgusting" and go "against everything we’ve done to build a more inclusive police department."

Kobel — who has been an employee with the NYPD for 29 years — retired to avoid a departmental disciplinary hearing after de Blasio suggested he would "be terminated immediately" if found guilty of violating NYPD rules, the head of the union representing him said.

"Given the current political climate and anti-police sentiment, DI Kobel did not see it as possible to get a fair administrative trial and decided to avail himself of the opportunity to file for retirement," Captains Endowment Association President Chris Monahan said.

In messages sent to the New York Times, Kobel denied being "Clouseau" when the posts came to light but acknowledged the allegations linking him to the posts would likely end his career.

"Nonetheless, despite my denial, it will likely end my career," Kobel wrote. "Where do I go to get my reputation back?"

CLICK HERE TO GET THE FOX NEWS APP

The allegations against Kobel were detailed in a report by a City Council oversight panel. City Council investigators linked the "Clouseau" messages to Kobel by matching information in them to publicly available details about Kobel’s life and career.

The NYPD’s Equal Employment Opportunity office is responsible for preventing and investigating employment and harassment claims and has implemented policy changes in recent years providing for lactation rooms, enabling officers to wear religious head coverings and making accommodations for transgender officers.

The Associated Press contributed to this report.