Hours after two NYPD officers were ambushed and shot dead in their squad car, New York City mayor Bill de Blasio condemned anti-police violence as reprehensible.

The mayor said, "When a police officer is murdered, it tears at the foundation of our society."

But on the way to the podium, de Blasio was met with a brief show of resistance from the officers he was about to support. Video from the New York Post shows NYPD cops turning their back on the mayor as he passed by them in the hallway.

It's a small symbol of the backlash that's broken out against de Blasio after Saturday's shooting, which has thrown the already-tense relationship between the mayor's office and the NYPD into turmoil.

Officers Wenjian Liu and Rafael Ramos were fatally shot while sitting in their squad car in Brooklyn. Police say the suspect previously posted angry social media rants, some of which centered on the killings of Michael Brown and Eric Garner by police.

>> Read more trending stories

NYPD Chief of Detectives Robert Boyce told reporters, "What we're seeing from this right now is anger against the government. ... There's others with talks of anger at the police, he specifically mentions Michael Brown and Eric Garner."

Now many New Yorkers are voicing anger at the mayor for partially supporting the protests, ranging from police unions, like union leader Pat Lynch who said, "There's blood on many hands tonight ... on the steps of city hall, in the office of the mayor."

To former police commissioner Ray Kelly, who told ABC, "Quite frankly, the mayor ran an anti-police campaign last year when he ran for mayor."

To ex-mayor Rudy Giuliani, who told Fox News, "This is not the time to say there is blood on his hands ... it is the right time to talk about his policies, however. His policies of allowing the protests to get out of control."

Most of the acrimony stems from de Blasio's refusal to crack down on the protests condemning the NYPD for the choking death of Eric Garner. The progressive mayor has been trying to walk a fine line, expressing sympathy for the protesters while still supporting the police.

But tensions between de Blasio and the police force existed even before the mayor took office. In his campaign, de Blasio promised to end the controversial stop-and-frisk police tactic, which had many defenders among the NYPD.

The mayor's office has also scrapped with the police unions over labor contracts in the past, more so than with the city's workforce unions.

The NYPD is still investigating the double homicide. A police spokesman says the NYPD is combing through the suspect's social media accounts and has recovered five videos and ten eyewitnesses from the scene.

This video includes images from Getty Images.