A blue wall of silently seething police officers turned their backs on Mayor de Blasio Saturday night — literally.

As the mayor and his entourage snaked through a jammed third-floor corridor at Woodhull Hospital, where two officers had been pronounced dead just hours earlier, scores of grieving cops faced the walls — and away from the leader they believe has failed them.

Earlier, de Blasio approached a cluster of cops at the Brooklyn Hospital and offered, “We’re all in this together.”

“No we’re not,” an officer replied tersely, according to a cop who witnessed the icy scene.

The rank-and-file’s anger at the mayor was palpable citywide.

“It’s f–king open season on us right now,” one officer said. “When is he going to step up?”

Speaking moments after the bodies of Officers Rafael Ramos and Wenjian Liu were driven away, as hundreds of cops stood at somber attention, Patrolmen’s Benevolent Association President Patrick Lynch said, “There’s blood on many hands tonight.”

“That blood . . . starts on the steps of City Hall, in the Office of the Mayor,” he said.

Just last week, cops began signing a “Don’t Insult My Sacrifice” waiver, distributed by the PBA, that warned the mayor and speaker to stay away from funerals of cops killed in the line of duty.

It is not known if the officers slain Saturday had signed the waiver. which singles out de Blasio and Council Speaker Melissa Mark-Viverito for their “consistent refusal to show police officers the support and respect they deserve.”

Many cops said they blame deBlasio for helping to create a climate of distrust in cops that has turned them into targets.

They pointed to Hizzoner just last week calling an assault by Brooklyn Bridge protesters on two NYPD lieutenants an ­“alleged” assault, even as dramatic video of the attack emerged.

De Blasio revealed in an ABC News interview earlier this month that he and First Lady Chirlane McCray had instructed their biracial son, Dante, about the “dangers” that police pose.

But just moments after the stunning cold shoulder in the hospital hallway, de Blasio wiped away tears at a press conference in which he spoke of meeting the families and praying “over the bodies of these two officers.”

“When a police officer is murdered it tears at the foundation of our society,” he said. “It is an attack on all of us, on everything we hold dear … Therefore every New Yorker should feel they too were attacked, our entire city was attacked, by this heinous individual.”

Answering a question about the politics at play in the wake of the tragedy, he said it was a “time to think about these families. I don’t think it’s a time for politics or ­political analysis. It’s a time to think about families that just lost their father, their husband, their son.”

Mark-Viverito, who accompanied the mayor to the hospital, tweeted earlier that she was “truly horrified” by the shooting and was praying for the officers and their families. Five minutes later, she tweeted: “Zero tolerance for any act of violence against police officers who protect & serve our city.”

Vernon Geberth, a retired NYPD homicide lieutenant who wrote what is considered the detective’s bible, “Practical Homicide Investigation,’’ was unmoved.

“De Blasio’s comments have given license to the anti-police activists and thugs to attack the police,” he said. “His comments have been absolutely despicable. Telling his son he should be afraid of the police? I’m not surprised these two police officers have been assassinated as a direct result of de Blasio’s comments.”