SEAFORD, N.Y. (Reuters) - 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 fifth member of the NYPD to die in the line of duty since December.

Services for the New York Police Department's Brian Moore at a Roman Catholic church at a Long Island suburb was attended by U.S. Senator Charles Schumer, New York Mayor Bill de Blasio, Police Commissioner William Bratton and dozens of other dignitaries.

His death was the latest reminder of the dangers faced by law enforcement officers in American cities. The NYPD buried two other patrolmen who were fatally shot while sitting in their patrol car in December.

U.S. Representative Peter King, a Republican who represents 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 reflect the politically charged climate that has enveloped police departments around the country, following several cases of unjustified use of police force that have resulted in the deaths of black men. The deaths have 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.

POLICE MOURN

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.

At the funerals in December, many officers turned their backs on the city's mayor when he eulogized the slain policemen, saying he contributed to an anti-police climate by failing to support them. Since then, relations between the mayor and police appear to have improved.

Moore, a decorated five-year veteran who followed in his father's footsteps in joining the NYPD, was gunned down over the weekend in the borough of Queens after trying to question a man who subsequently fired into his unmarked car. The plainclothes officer died of his wounds on Monday.

The suspect, Demetrius Blackwell, 35, was arrested shortly after the shooting and remains 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.