Police officers have turned out in numbers to show respect for their colleague
Tens of thousands of people are attending the funeral in New York of Rafael Ramos, one of the two policemen shot dead a week ago.
Vice-President Joe Biden praised the "finest police department in the world" at the service, attended by police forces from across the US and Canada.
Officer Ramos's coffin lay overnight in the church in the Queens district.
He and Wenjian Liu were shot by a man who said he was avenging the killing of unarmed black people by police.
Police have yet to announce funeral details for Officer Liu.
Police Commissioner Bill Bratton told the mourners Officer Ramos had been a "hero".
New York Governor Andrew Cuomo and New York Mayor Bill de Blasio also paid tribute to the dead officer as well as to the New York Police Department (NYPD).
Police officers and union representatives, angered by the mayor's earlier support for anti-police, had turned their backs on him at the hospital where the two men were pronounced dead on 20 December.
'Killed by a madman'
"To the Ramos family, we're all lucky to have Rafael," Vice-President Biden told the congregation at the Christ Tabernacle Church in Queens.
"He didn't just have a bible in his locker, he lived it in his heart. He was a cop for all the right reasons."
Officer Ramos, 40, had been studying to become a police chaplain and was described as "a man of great faith" by a pastor who knew him.
Commissioner Bratton, his voice choking with emotion, announced he had promoted both officers posthumously to Detective First Grade.
A painting of Officer Ramos could be seen at the church
Police from all over the US came to the funeral
Canadian Mounties attended the funeral too
"Rafael Ramos was assassinated because he represented all of us," he said.
The two police officers had been killed by a "madman", he continued, who had only been able to see two uniforms, not the people wearing them.
When the Ramos family arrived for the service, the eldest son Justin, wearing his father's NYPD jacket, was hugged by a police officer.
The two police officers were shot following weeks of protests against police.
The protests came after a grand jury decided not to press charges against a white police officer over the death of unarmed black man Eric Garner, who was placed in a chokehold while being restrained by New York police officers.
Mr Garner was one of several black men or boys killed by police in 2014 whose cases galvanised protest groups.
Mr de Blasio has been accused of stoking tensions between police and minorities in the city.
Immediately after the double killings, police unions said the mayor had "blood on his hands" and former New York Governor George Pataki described the shootings as "a predictable outcome of divisive anti-cop rhetoric" from the mayor.
However, Mr Bratton said for his part that he strongly rejected the notion the mayor had increased the risk to police officers by appearing to side with protesters following the death of Mr Garner.
Black man Ismaaiyl Brinsley, 28, shot and killed officers Ramos and Liu as they were sitting in a patrol vehicle in the borough of Brooklyn. He then killed himself nearby.
Brinsley had a history of violence and mental instability and had been arrested at least 19 times in Georgia and Ohio, police said. Before attacking the police officers, he had shot and injured his girlfriend.
On the day of the shooting, he went on social media to say he was planning to kill police officers.