Mayor Bill de Blasio reacted with outrage on Thursday over the revelation in a New York Post front-page story that the NYPD since 2011 failed to make convicted pedophile Jeffrey Epstein report to its sex offender unit, despite a judge’s order.

“Something’s very broken,” de Blasio said during an appearance on MSNBC. “He gamed the system and used a legal loophole to get away with it. It’s ridiculous.

“He should have had to report in all the time, he’s a danger to society,” Hizzoner fumed.

Epstein ought to have reported to the NYPD’s Sex Offender Monitoring Unit every 90 days after he was forced to register as a sex offender following a 2008 plea deal. Instead, the cops argued that Epstein — who maintains a seven-story townhouse on the Upper East Side — didn’t need to report to them because he claims his primary residence is in the US Virgin Islands.

A state judge disagreed in 2011 and told the NYPD to make him check in — but the department ignored the order in defiance of the judge, sources said.

“The NYPD can’t modify a court order,” a source previously told The Post. “If the judge says he has to report here, he has to report here.”

De Blasio said he would instruct the cops to see “if we can fight back legally.”