Toronto police are among the hundreds of officers who gathered in New York Saturday for the funeral of Officer Rafael Ramos, who was gunned down along with his partner by a man who had promised revenge for the deaths of two black men at the hands of police.

Several dozen Toronto officers made the trip to Queens, N.Y., in order to show solidarity with members of the New York City Police Department, said Mike McCormack, head of the Toronto Police Association.

RCMP officers were also present, as was noted by New York media on Twitter.

McCormack described the funeral as the biggest he has ever attended, and said there was a “different tone” from most police funerals. “Not only of the loss and the grief, but also a little bit of underlying tone of anger and frustration,” he said.

Tensions have been growing in New York following the deaths of Ramos and his partner Officer Wenjian Liu on Dec. 20. The two men were the first officers to die in the line of duty in New York since 2011.

Comments made by Mayor Bill de Blasio before Ramos and Liu were killed angered many officers, who turned their backs to the mayor when he visited the hospital where the two men were pronounced dead. The same gesture was repeated Saturday by hundreds of officers who had gathered outside the funeral service.

“Pretty well every officer turned and gave their back,” McCormack said Saturday. “And that’s due to inflammatory comments that the mayor has been making around police and relations with the community."

“Rightfully so,” he added.

However, once inside the church, de Blasio received applause before and after speaking.

"All of this city is grieving and grieving for so many reasons," the mayor said. "But the most personal is that we've lost such a good man, and the family is in such pain."

In early December, New York’s mayor told ABC News that he asks himself each night whether his son Dante, who is black, would be safe not just from crime, but from police.

“What parents have done for decades who have children of colour, especially young men of colour, is train them to be very careful when they have an encounter with a police officer,” de Blasio said.

He later said that there are a series of things that need to be done to address systemic racism in policing, including retraining police forces and giving officers body cameras that would record their interactions with the public.

Gunman referenced Michael Brown, Eric Garner deaths

The gunman in the attack, Ismaaiyl Brinsley, killed himself after ambushing the two officers. Police said earlier that day he had shot and wounded an ex-girlfriend in Baltimore.

Before the attack, Brinsley had referenced the killings of Michael Brown and Eric Garner in a series of online posts. Both the Brown and Garner case have prompted protests in New York City, and across the U.S.

With files from The Associated Press