Tens of thousands attend funeral for NYPD officer Rafael Ramos

Police officers carry the casket of slain NYPD officer Rafael Ramos out of his funeral at Christ Tabernacle Church to his final resting place in the Queens borough of New York December 27, 2014.Reuters

Thousands of police officers from around the US and Canada attended the funeral of New York police officer Rafael Ramos at Christ Tabernacle Church in Glendale, New York on Saturday.

Ramos, 40, and Wenjian Liu, 32, were shot last Saturday afternoon while sitting in their patrol car in Brooklyn after weeks of anti-police protests.

The gunman, Ismaaiyl Brinsley, who later committed suicide, indicated on social media that he wanted to avenge the deaths of Michael Brown and Eric Garner, both unarmed black men killed by police.

The coffin, draped in the NYPD's green, white and blue flag, was carried into the church by officers in ceremonial uniform, while colleagues from his Brooklyn station stood in salute.

NYPD helicopters flew over the church in 'missing man' formation, a traditional tribute for a fallen officer.

At the start of yesterday's service Jonathan Collado, pastor at Christ Tabernacle, quoted Martin Luther King. "The old law about an eye for an eye leaves everybody blind," he said, according to the Sunday Times.

Ramos, who had been in the force for two years, was known as a devoted family man and Christian, and was due to be commissioned as a lay chaplain on the day he was killed.

Justin Ramos, the officer's 19-year-old son, arrived at the funeral wearing his father's police jacket. Rafael Ramos is also survived by his wife, Maritza, and his younger son Jaden, 13.

A memorial service and wake were held on Friday, at which Justin said: "Dad, I'm forever grateful for the sacrifices you made to provide for me and Jaden."

"He was my absolute best friend," he added.

Rev Marcos Miranda, president of the New York State Chaplain Task Force, told the Huffington Post that Ramos "loved God and he loved humanity".

"He thought being an NYPD officer was like doing ministry to God by protecting and serving your community," Miranda added.

The shooting followed weeks of protests about police violence towards black men.

New York Mayor Bill de Blasio described the NYPD as "the finest police force in the country", when he spoke at the funeral.

Officers watching on screens outside the church turned their backs as the mayor spoke.

De Blasio's relationship with the police has been tense since the shooting. Many have felt that mayor has given his support to the protesters and not the police.

Police officers also turned their backs to him when he arrived at the hospital where the two officers were pronounced dead last week.

"All of this city is grieving and grieving for so many reasons," de Blasio said in his 10-minute eulogy "but the most personal is we've lost such a good man and a family is in such pain."

Vice President Joe Biden also spoke at the funeral. "I believe that this great police force of this incredibly diverse city can and will show the nation how to bridge any divide," he said.

New York Police Commissioner Bill Bratton awarded Ramos the posthumous title of chaplain for the department. He also said at the funeral that both Ramos and Liu had been promoted to detective, first grade.

Police have yet to announce details for Liu's funeral.