(Reuters) - Ten of thousands of police officers were expected along with politicians and other mourners on Sunday at the funeral of a New York City policeman killed last month in an ambush that deepened a rift between Mayor Bill de Blasio and the force.

Wenjian Liu, 32, and his partner, Rafael Ramos, 40, were murdered on Dec. 20 as they sat in their squad car in Brooklyn after killer Ismaaiyl Brinsley had stated he was seeking vengeance for the deaths this summer of two unarmed black men at the hands of white police officers.

Brinsley killed himself after ambushing the officers.

With de Blasio expected to speak at Liu's funeral, police commissioner Bill Bratton told officers ahead of Saturday's wake to refrain from the "act of disrespect" seen at Ramos' funeral a week ago, when thousands of officers turned their backs on the mayor.

"A hero's funeral is about grieving, not grievance," Bratton wrote in a memo to officers. De Blasio and Bratton entered the funeral home together for the wake as officers stood guard by the entrance, saluting both men as they went in.

The murders frayed already strained relations between the police force and de Blasio, who sharply criticized the NYPD's "stop-and-frisk" tactics during his 2013 campaign.

The liberal mayor also offered qualified support for the wave of protests triggered by the two black men's deaths in New York and Ferguson, Missouri, and has said he talked to his bi-racial son, Dante, about interacting with police.

Immediately after Liu and Ramos were shot, Patrick Lynch, the head of the city's largest police union, expressed scorn for de Blasio, saying there was "blood on many hands."

Ramos' funeral a week ago among the largest in NYPD history, with more than 20,000 officers from around the country on hand. When de Blasio began his eulogy there, many uniformed officers turned their backs in a gesture of disdain, which Bratton called inappropriate, saying it had stolen the "valor, honor and attention" that was rightfully due the slain officer.

In his memo, Bratton said he understood emotions were running high among the rank and file, adding that his entreaty to the department was not a mandate and he was not threatening to discipline those who did not comply. "But," he said, "I remind you that when you don the uniform of this department, you are bound by the tradition, honor and decency that go with it."

(Additional reporting by Jonathan Allen; Writing by Frank McGurty; Editing by Chris Michaud & Kim Coghill)