Thousands of policemen from around the United States gathered on Friday at the funeral of a 25-year-old New York City officer who was shot in the head while on patrol, making him the third member of the NYPD killed in the line of duty since December.
Services for the New York Police Department's Brian Moore at a Roman Catholic church in a Long Island suburb were attended by U.S. Senator Charles Schumer, New York Mayor Bill de Blasio, Police Commissioner William Bratton and dozens of other dignitaries.
"He knew he was making the city safer, he knew he was making a difference in people's lives. It energized him," de Blasio said in eulogizing Moore. The decorated, five-year veteran of the force had followed his father and uncle into the NYPD.
Moore, who was promoted posthumuously to the rank of detective, is the latest reminder of the dangers faced by law enforcement officers in American cities. In December, two other New York patrolmen were fatally shot while sitting in their patrol car.U.S. Representative Peter King, a Republican representing the congressional district where Moore lived, said the officer's slaying attests to the courage and sacrifice that police make to protect the public.
"It's actually been a terrible year for the police because they've been attacked, they've been assailed and, meanwhile, they're being shot and murdered," he said before entering the church. "But the thing about cops is they keep going."
King's comments also reflected the politically charged climate that has enveloped police departments around the country, following several controversial episodes involving black men and deadly police force.
The deaths sparked demands for a review of police tactics and measures such as requiring officers to wear body cameras on duty.
Six Baltimore police officers were charged last week in the death of Freddie Gray, a black man who sustained spinal injuries while in police custody. His death triggered a week of protests in the city, punctuated by a night of looting and arson.
Absent from Moore's funeral at St. James Roman Catholic Church in Seaford, east of New York City, was any open sign of disdain for de Blasio, the mayor.
At the funerals in December and January, many officers turned their backs on the de Blasio when he eulogized the slain policemen, and said the mayor had fanned hostility to the police by failing to support them. Since then, relations between the mayor and police appear to have improved.
Moore was shot over the weekend in the borough of Queens after trying to question a man who then fired into his unmarked car. The officer, who was in plainclothes when he was shot, died of his wounds on Monday.
The suspect, Demetrius Blackwell, 35, was arrested shortly after the shooting and remained in custody. Police also recovered a five-shot revolver that had been stolen in Georgia in 2011.
In December, the gunman who killed officers Wenjian Liu and Rafael Ramos on a Brooklyn street had left messages saying he wanted to kill police at random out of vengeance for the death of black men at the hands of white officers. There were no indications that the suspect in Moore's shooting was similarly motivated.
More from AOL.com:
Class of 2015 carves out (unwanted) spot in history
Official: 4 killed in small-plane crash on Atlanta highway
With visit to South Dakota, Obama visits all 50 states