Hundreds of NYPD officers in dress blue, joined by cops from other cities, turned their backs Sunday to Mayor Bill de Blasio in silent protest as the city's chief executive delivered the eulogy at the Brooklyn funeral of slain Officer Wenjian Liu in Brooklyn.

Packing the street for blocks outside the Dyker Heights funeral home, they faced away from de Blasio's image on large television screens set up so the service's overflow crowd could watch the memorial.

But many other officers, particularly those standing closer to the funeral home, did not join the protest and faced the screens, listening to the mayor reflect on Liu's life.

NYPD Commissioner William J. Bratton in a weekend directive had urged his cops to refrain from public displays of discontent, saying the wake and funeral are "about grieving, not grievance."

NYPD Patrolmen's Benevolent Association President Patrick Lynch after the Dec. 20 murders of Liu and his partner Officer Rafael Ramos in Bedford-Stuyvesant, Brooklyn, by a gunman who posted anti-police rants on social media has blamed de Blasio for not supporting the NYPD. Lynch said "blood on the hands starts on the steps of City Hall, in the office of the mayor."

Dozens of cops had turned their backs to de Blasio when he arrived at the Brooklyn hospital where Liu and Ramos were taken the night of their deaths. Hundreds did so again at Ramos' Dec. 27 funeral in Glendale, Queens.

De Blasio in his eulogy Sunday focused how Liu, 40, who emigrated from China as a teenager, lived.

"New York City stands a little taller today because he walked among us," he said.

Speaking after the mayor, Bratton underlined officers' responsibilities to the public: "The mission has not changed. ... There are people who need us. We will not abandon them."

Spokesmen for de Blasio did not immediately comment on the continent of cops who chose Sunday to turn their backs to the mayor. A PBA spokesman also did not immediately return a request for comment.

Zachary Slavin, a retired NYPD lieutenant, before the funeral said he used to patrol the same block where Liu and Ramos were killed.

"Their blood on the ground is my blood," the Rockville Centre resident said. Slavin said he saw nothing wrong with cops protesting de Blasio, adding that the mayor offended the department in remarks after the Dec. 3 Staten Island grand jury decision not to indict a white police officer in the death of Eric Garner, who was black. De Blasio said he and his wife, Chirlane McCray, had for years cautioned their biracial teenage son, Dante, on interacting with the police.

"I'm a white guy; I talk to my children about respecting the police," Slavin said. "I think the mayor's creating a climate that creates hostility toward the police and encourages race baiters ... "

Many others accused de Blasio of supporting the tens of thousands of protesters who marched on city streets against police brutality over the police themselves.

Dyker Heights resident Lorraine Sarutto, 67, meanwhile, said of the police department, "I think they know we stand behind them."

The current tensions with police and de Blasio are creating more racial tensions in the neighborhood, she said.

"These neighborhoods are Italian and Spanish, Asian," she said. "We have African-Americans here, we've got Polish people, we got Russian people. Everybody lives in harmony. we don't need these people ... [protesters] coming through the streets telling us how bad these guys are. These guys keep our street safe."

John Mangan, 61, of Levittown, early in the day staked out a spot outside of the funeral home with a sign with two messages: "God Bless the NYPD" and "Dump de Blasio."

Mangan, a retired 20-year veteran of the NYPD who said he also attended Ramos' funeral last weekend, said, "I agree with turning their backs. The mayor turned his back on the police department a long time ago. He ran on the ticket of cop-bashing."

De Blasio was elected on a platform that included pushing reforms to the NYPD's stop-and-frisk policy.

With Valerie Bauman and John Asbury