The NYPD is investigating the behavior of a Brooklyn precinct commanding officer who allegedly told his officers to “shoot” 50 Cent — and the rapper announced publicly on Sunday that he was never notified by police about the threats against him.

Deputy Inspector Emanuel Gonzalez, commanding officer of Sunset Park’s 72nd Precinct, allegedly told officers during roll call that if they see the rapper they should “shoot him on sight,” police sources said.

Gonzalez gave his cops the message on June 7 — the same day as the Bronx Smoker, where Fitty was headed to watch cops who have beefs with each other duke it out.

The police department confirmed that “the matter is under internal review.”

The rapper, whose real name is Curtis James, posted a series of photos to Instagram on Sunday, and said he was never made aware of the threat against him.

“I take this threat very seriously and im consulting with my legal counsel regarding my options moving forward,” he wrote in one of Sunday’s three posts to his account. “I am concerned that I was not previously advised of this threat by the NYPD. #NYnotSafe#TheGangstagotabadge”

A different Instagram post features Gonzalez’s NYPD photo.

“This is Emanuel Gonzalez commanding officer of the 72percinct [s.i.c.]. He think he got beef with me,so he sending the Homies to put some work in. NYNOTSAFE #thegangstagotabadge”

“This guy Emanuel Gonzales is a dirty cop abusing his POWER,” he wrote in a separate post. “The sad part is this man still has a badge and a gun.”

The Brooklyn boss and the rapper have had beef of their own ever since Gonzalez tried to squeeze the owner of hip-hop club Love & Lust for gifts.

The club owner, Imran Jairam, claimed the cops and State Liquor Authority “unfairly targeted” the club when he didn’t give Gonzalez what he’d requested.

Fitty then appeared to threaten the Brooklyn boss in a since-deleted Instagram post in May, writing “Get the strap” — his token catchphrase, which he attaches to social media postings nearly daily. “Strap” is slang for gun.

“They trying to shut him down,” the rapper also posted to Instagram, referring to Jairam.

After the Post exclusively reported NYPD’s investigation into the rapper, Fitty again took to Instagram, where he posted a picture of his application to trademark the catchphrase.

“So here’s the trademark, investigation over,” he wrote of the application, taunting the NYPD, “Back to fight crime alright guys. Get the strap.”