The NYPD has opened an internal investigation into Sergeant Ed Mullins, the long-serving police union leader with a history of promoting racist content, over his recent declaration of "war" on Mayor Bill de Blasio, Gothamist has learned.

The NYPD's Internal Affairs Bureau launched the investigation into the Sergeant Benevolent Association president last week, according to a government source familiar with the matter. The inquiry was sparked by the SBA's recent tweet "declaring war" on the mayor, following the shooting of two on-duty cops.

The probe will include a "deeper dive" into Mullins's history of offensive statements, and "whether those views undermine his capacity as a sergeant," according to the source.

Though his duties are primarily union-related, Mullins remains a sworn officer, and collects a taxpayer-funded salary of $133,524. His broadsides against perceived enemies of cops have frequently gained scrutiny for crossing a line into incitement and bigotry, even by the standards of police union bosses.

This past summer, Mullins made headlines for emailing an explicitly racist video to the SBA's 13,000 members that likened black people to "monsters" and public housing to a "war zone." Despite deeming it "the best video I've ever seen" and urging the sergeants to listen to every word, he later claimed to have not watched the full video.

The SBA's Twitter account, which is controlled by Mullins, has previously said that "Ferguson Missouri was a lie," suggested that college students who protest police are asking for mass shootings, and lashed out at a police oversight board for reminding New Yorkers of their constitutional rights.

The union leader has also been among the loudest voices opposing recent bail reform. And his campaign against fare-beaters and homeless people inside the subway system often involves shaming individual New Yorkers.

Jeffrey Fagan, a law professor at Columbia University who specializes in police accountability and criminal law, said that Mullins's statements show that his responsibilities as a sworn officer are "compromised."

"There are clear signals that he makes assumptions about criminality when approaching certain groups of people," he said.

At the same time, Fagan said it would prove challenging for IAB to build a case against him for his attacks against de Blasio, given the vaguely worded threat likely qualifies as protected speech. A Lindsay-era executive order allows certain public sector union leaders to hold on to their city jobs while facilitating labor activities.

The NYPD's patrol guide prohibits all uniformed officers from "engaging in conduct prejudicial to good order, efficiency, or discipline of the Department," and also proscribes officers from knowingly associating with people who "disseminat[e] defamatory material," though there is no specified penalty for these offenses.

De Blasio, a longtime punching bag for Mullins, said the recent barrage of tweets sent by Mullins should result in "consequences," but repeatedly declined to elaborate on what that meant. "I just said what I'm going to say," the mayor said.

Asked about the IAB investigation, City Hall spokesperson Freddi Goldstein reiterated those calls for discipline.

"Ed Mullins is supposed to be a leader in this city," she said. "It’s time he act like it. His comments were clearly inappropriate and he should be held accountable.”

Inquiries to Mullins and the SBA were not returned. A spokesperson for the NYPD declined to comment.