Recently, I signed out of the Midtown North Precinct for the final time, concluding a 25-year career with the New York City Police Department. Appropriately enough, my last day on the job was the day after Police Commissioner James O’Neill unceremoniously fired police officer Daniel Pantaleo following a years-long investigation stemming from Eric Garner’s death.

That political hit job, covered with City Hall’s fingerprints, was a stark reminder of how much the NYPD has changed and why it was no longer worth it for me to wear blue each day.

Like many in the NYPD, I’m a New Yorker, so I personally have witnessed how the city evolved from chaotic, drug-filled and crime-ridden to safe, prosperous and livable in the 1990s and 2000s under Mayors Rudolph Giuliani and Michael Bloomberg.

In the last six years, however, Mayor Bill de Blasio has overseen an unprecedented regression in the quality of law enforcement and in life in general in New York. The NYPD brass, particularly under Commissioner James O’Neill, has been complicit in this breach of public trust and made it nearly impossible for the best officers to do their jobs well and uphold their oath to protect the public.

Make no mistake about it: New York City is no longer a safe city.

Under the cover provided by the commissioner, the mayor regularly touts statistics indicating that crime is at an all-time low. Do not believe those statistics for one second.

Police officers have simply stopped making arrests for whole categories of crimes, including open-air drug use and drug dealing, turnstile-hopping, panhandling, harassment and other crimes that officers have been explicitly instructed to ignore.

In fact, earlier this summer, Assemblywoman Yuh-Line Niou expressed shock and outrage when she was harassed and verbally abused by ticket brokers near Battery Park and police officers declined to take action.

The officers explained that the mayor no longer wanted them making arrests for certain offenses. Ironically, legislators like Niou have only contributed to the toxic environment of lawlessness and hostility toward police work.

And who can blame police officers for not taking risks that could place their careers, pensions and family’s well-being in jeopardy?

The perps have figured out this perverse system too. Many career criminals routinely file grievances with the Civilian Complaint Review Board — which is totally politicized and hostile to police officers — for any interaction, often making patently absurd allegations of racism. And even the NYPD itself has become petty and retaliatory against officers who make too many waves and do not go along with prevailing bureaucratic politics.

And district attorney’s offices across the city have also been compromised, so that when police officers do go through the trouble of making arrests, prosecutors often refuse to bring charges unless the crimes are politically unpopular or the perpetrators fit a preconceived identity narrative.

Finally, radical judges in New York City courts routinely refuse to uphold the law and allow dangerous criminals, including habitual drug dealers, to walk free.

Mayor de Blasio has taken a job that stood for service, excellence and maintaining law and order and helped reduce it to a politicized chaperoning service. Meanwhile, Commissioner O’Neill, who fashioned himself as a cop’s cop, has forever lost the respect and confidence of officers who rightly see his firing of Daniel Pantaleo as a cowardly bow to political correctness.

This is what the NYPD has become, and New Yorkers should not be complacent. The New York of 10 years ago that we perhaps took for granted is gone. And as long as the good guys in blue are shackled from doing their jobs, it won’t be coming back.

Rick Khalaf is a retired NYPD lieutenant.