A deranged man allegedly stormed into a Brooklyn police station house and attempted to steal a cop’s firearm over the weekend — and was then let back on the street by a judge without bail.

Kurdel Emmanuel lunged at the officer inside the 83rd Precinct Station house Saturday and violently clutched her firearm belt while attempting to yank out her service weapon, according to court papers.

At his arraignment Sunday, Emmanuel was hit with a slew of charges, including assault on a police officer, attempted criminal possession of a weapon and attempted robbery.

Prosecutors asked Brooklyn Criminal Court Judge Loren Baily-Schiffman to hold him in lieu of $250,000 bail.

Instead, she ordered Emmanuel released on his own recognizance.

Ed Mullins, head of the Sergeant’s Benevolence Association, said the suspect is “mentally ill,” and sent out a safety alert describing him and urging cops to “remain cautious.”

Mullins claimed Emmanuel would have “killed police officers” if he’d gotten hold of the gun.

Emmanuel was at his home in East Flatbush Sunday night, according to his stepmother, who told The Post she “absolutely” has tried to help him.

“He has mental- health issues,” the woman said. “The problem you have is you have someone who is not well, and you can still get conflicting stories.”

Law enforcement slammed the judge for the release — which took place on the eve of a wake for Officer Miosotis Familia, who was killed by an apparently mentally disturbed man last Wednesday.

“Prosecutors are taking this case seriously but the judge clearly didn’t,” one source said.

Dennis Quirk, president of the New York State Court Officers Association, declared, “This idiot should be removed from the bench.”

When called for comment Sunday, Baily-Schiffman hung up on a reporter.

Additional reporting by Emily Sauland Joe Marino