NEW YORK - New York City Mayor Bill de Blasio on Monday drew heckles and boos along with applause when he addressed graduating police cadets on Monday, two days after thousands of uniformed officers turned their backs on him at a slain policeman's funeral.
The mayor's speech came as he struggles to mend the most toxic rift between police and City Hall in decades.
The United States' biggest city has become a focal point in a national debate over the killings of unarmed black men by white police.
Some booed as the mayor began his speech before 884 graduating cadets at Manhattan's Madison Square Garden arena. He warmly praised the police department.
"You will confront all the problems that plague our society," de Blasio told the new officers.
"Problems that you didn't create."
A heckler cried out, "You created them!"
Some in the audience applauded and cheered the outburst.
De Blasio, briefly flustered, continued with his speech.
In the audience, a dozen or so people turned their backs on the mayor, repeating a gesture by thousands of officers from around the country at Saturday's funeral for Police Officer Rafael Ramos. Police first turned their backs on the mayor a week earlier when he arrived at the hospital where Ramos and his partner, Wenjian Liu, were taken after they were shot.
After the ceremony, some of the new officers said they appreciated de Blasio's support.
Before the mayor had even finished speaking, his press office sent an email to journalists, apparently prepared in advance, saying it was not the first time a New York mayor was booed at a police graduation. The email included snippets from old news reports about de Blasio's three predecessors getting similar treatment.
Asked whether police had turned their backs on other mayors, Marti Adams, a spokeswoman for de Blasio, said she would have to double-check.
The rift between de Blasio and many in the police department preceded his taking office in January.
De Blasio made police reform a main theme of his campaign.
The rift deepened when de Blasio expressed qualified support for protests sparked by the deaths of unarmed black men at the hands of white police officers.
Some officers began openly shunning de Blasio after Ramos and Liu were ambushed and shot dead as they sat in their squad car in Brooklyn.
The man who killed them, Ismaaiyl Brinsley, said he was avenging the deaths of two unarmed black men who died in confrontations with white officers last summer in Ferguson, Missouri, and New York. Brinsley killed himself a few minutes after shooting the officers.
In Los Angeles on Monday, police detained one man and were searching for a second after what they said was an unsuccessful sniper attack on two police officers in their patrol car on Sunday night. No one was injured, and it was not clear whether the incident was connected to the police protests.
Officer Liu's wake was scheduled for Saturday in Brooklyn and his funeral for Sunday.
The slaying of Ramos and Liu has become a rallying point for police forces beleaguered by months of demonstrations against police tactics in New York and other cities.
The demonstrations began in August after a white police officer fatally shot an unarmed black man, Michel Brown, 18, in Ferguson.
The shooting and a grand jury's decision not to indict the officer, Darren Wilson, triggered months of often-violent protests in the St. Louis suburb.
On July 17, Eric Garner, a 43-year-old black man, died after New York police put him in a banned chokehold while arresting him for illegally selling cigarettes.
The grand jury in that case decided not to indict the officer who applied the chokehold, Daniel Pantaleo.
The US Justice Department is conducting a civil rights investigation.