Mayor Bloomberg yesterday tore into the Brooklyn judge who turned a dangerous ex-con loose after his drug arrest last month, saying accused cop-killer Lamont Pride would have been locked up if she had done her job right.

“Obviously, the judge should have done more work,” Bloomberg fumed.

Brooklyn Criminal Court Judge Evelyn Laporte freed Officer Peter Figoski’s alleged murderer without bail following his Nov. 3 arrest, even as prosecutors asked for $2,500 bail and explained there was a warrant for Pride’s arrest after an August shooting in his North Carolina hometown.

“Obviously, everyone could have done more work to see what the warrants were in North Carolina,” Bloomberg said. “Obviously, it was not done.”

The mayor’s outburst against the prosecutor-turned-judge came after New York and North Carolina officials traded blame for the foul-ups that let Pride roam free before he allegedly shot Figoski in the face.

“The reason he was not behind bars the last time is that a judge here in New York not only didn’t put him behind bars, she didn’t even think it was appropriate for bail,” said a seething Bloomberg at a City Hall press conference on the topic of illegal gun sales.

“And he had a long history of not showing up [in court]. He had a long criminal record.”

Bloomberg then provided this simple advice: “If the judge didn’t understand the warrant from North Carolina, the judge could have picked up the phone.”

Laporte, who was previously a judge in Manhattan Criminal Court, was described by one defense lawyer as “no softie” and hailed by a former colleague in the Brooklyn District Attorney’s Office as “smart” and “very conscientious.”

And at her 2005 swearing-in ceremony, Laporte had praise heaped on her by DA Charles Hynes, her former boss.

When she was a prosecutor, she mostly handled domestic-violence and homicide cases.

But she also had critics who didn’t take her seriously and harped on her habit of matching her outfits with her fingernails.

“She can be a bit of a . . . princess,” a source said.

In Pride’s Nov. 4 court appearance for a drug-possession charge, the prosecutor told Laporte that the defendant “has an outstanding warrant in North Carolina for a shooting,” the court transcript shows.

But instead of tossing him in jail, Laporte decided not to hold Pride on bail, letting him walk free.

And days after Laporte’s bail bungle, another judge, Shari Michels, put an arrest warrant on hold when Pride missed a court appearance.

Pride’s active North Carolina warrant wasn’t even mentioned by prosecutor Erica Fenstermacher in front of Michels, the daughter of a former longtime city councilman.

“It’s not a lot of work to do to protect the public,” Bloomberg said. “It wasn’t done here, plain and simple.”

Laporte, Michels and Fenstermacher would comment yesterday as Bloomberg cranked up the heat for the slip-ups.

“It is important to remember that in New York state, judges have discretion when setting bail,” New York courts spokesman David Bookstaver said.

Sources yesterday described how Pride remained stoic during a videotaped interview with detectives and a prosecutor at the 75th Precinct. He insisted that his stolen 9mm Ruger accidentally fired when he pointed it at the cop while trying to flee.

“I shot him, but I didn’t mean to,” Pride said, according to a source.

Pride, 27, also confessed that he wasn’t going to 25 Pine St. in Brooklyn to buy drugs — he intended to rob the home of drugs and money, sources said.

Pride allegedly pistol-whipped a man into unconsciousness during the home invasion that was interrupted by a pair of cops — leading to his confrontation with Figoski.

Nelson Morales, Ariel Tejada and Kevin Santos, three of the other small-time crooks charged with Figoski’s murder, also confessed they were in on the robbery, sources said. Morales admitted he planned the whole thing, sources said.

Only alleged getaway driver Michael Velez clammed up, sources said, hiring a lawyer instead. A surveillance video obtained by The Post shows Velez sneaking away at the instant cops pulled up to the scene of the shooting.

Speaking of Velez, a source said he “wasn’t playing ball. He was saying stuff like, ‘What’s in it for me?’ ”