Police officers in New York have defied calls not to stage a protest at the funeral of a murdered comrade, pointedly turning their backs as Mayor Bill de Blasio paid tribute to the murdered patrolman.

Despite an appeal yesterday from New York police commissioner Bill Bratton not to protest against Mayor de Blasio at the funeral, dozens of officers in a crowd of thousands appeared to turn away from giant screens relaying the mayor's address inside a Brooklyn funeral home.

32-year-old Wenjian Liu who was shot dead with 40-year-old partner Rafael Ramos on 20 December as the pair sat in their patrol car in Brooklyn.

The murders in broad daylight shocked America's largest city and saw members of the police turn furiously against Mayor de Blasio for having supported protesters calling for police reform.

The gunman in the killing of Mr Liu and Mr Ramos, Ismaaiyl Brinsley, had announced on social media that he intended to attack police officers in apparent retaliation for the deaths of two unarmed black men killed by police.

The nationwide protests over the deaths of black men at the hands of police exposed a schism between Mr de Blasio and New York's police force.

New York police had been enraged by comments from the mayor that he counsels his biracial son to be particularly careful around police officers.

However, New York Police Chief Bratton had urged officers not to use Liu's funeral as a platform to air their grievances with Mayor de Blasio.

"A hero's funeral is about grieving, not grievance," Mr Bratton wrote in a memo.

"I issue no mandates, and I make no threats of discipline, but I remind you that when you don the uniform of this department, you are bound by the tradition, honour and decency that go with it."