The funeral at the Christ Tabernacle Church, in the Glendale neighborhood of Queens, was broadcast to thousands of police who gathered outside.
The killing of Officers Rafael Ramos and Wenjian Liu came amid heightened tensions between the police and the mayor over what some police saw as a lack of support for the force.
The atmosphere was mostly respectful, but there were scattered signs of protest even before the police officers action when the mayor spoke.
A block from the church, though, retired NYPD Officer John Mangan held a sign that read: “God Bless the NYPD. Dump de Blasio.”
In his speech, the mayor seemed to try to reach out to police, honoring not only Ramos, but the entire NYPD.
After directing his remarks to the Ramos family, he said he wanted to “extend my condolences to another family — the family of the NYPD — that is hurting so deeply right now.”
The night after Ramos and Liu were shot, officers gathered at the hospital where they had been taken turned teir backs on de Blasio when he arrived.
De Blasio created controversy with his response to demonstrations about police relations with minorities, after a grand jury declined to indict an NYPD officer in the death of Eric Garner, a Staten Island man who died after he was put in a chokehold during an arrest for selling loose cigarettes.
The mayor, whose wife is black, said he has spoken to his mixed race teen son about how he should act if he is stopped by police.
In speaking about protesters who were arrested and charged with assaulting police during a demonstration in New York, de Blasio used the word “allegedly,” which some in the NYPD seemed to take as a slight.
Patrolmens Benevolent Association president Patrick Lynch and de Blasio have been locked in a public battle over treatment of officers following the grand jury’s decision.
The week before the shooting of Ramos and Liu, the PBA leader suggested police officers sign a petition demanding that the mayor not attend their funerals should they die on the job.