A man armed with a knife has stabbed a New York policeman in the neck and two officers who ran to his rescue were wounded before they shot the attacker multiple times, police said.
All four were taken to Kings County Hospital where the police were in stable condition and the suspect was in critical condition, police said.
The attack in Brooklyn came amid mass protests and some rioting in New York over the death in Minneapolis of George Floyd, an unarmed black man, while in the custody of white police officers.
It was not immediately clear if the attack was related to the protests, but Police Commissioner Dermot Shea said the police were on duty to stop looting.
A man walked "casually" up to one of the officers near Church and Flatbush avenues in Brooklyn, pulled out a knife and stabbed him in the left side of his neck, Shea said.
"It appears to be a completely cowardly, despicable, senseless attack on a defenceless police officer," Shea said. "Thank God we're not planning a funeral."
The two other officers heard shots fired from two blocks away and ran over and saw that the suspect had the wounded police officer's gun, he said.
The two officers were shot in their hands in the struggle. Shea did not give details on how they were shot.
Prosecutors brought new criminal charges against four Minneapolis police implicated in the death of Floyd, pinned by his neck to the street for almost nine minutes during an arrest that has sparked more than a week of nationwide protest and civil strife.
Thousands of people are still on the streets around the US but vigils have replaced looting and peaceful marches have replaced arson on the ninth night of protests over Floyd's death.
Duchess of Sussex issues message to students
The Duchess of Sussex has issued a personal message about the impact of Floyd's death, saying his life "mattered".
Addressing students graduating from her former school in Los Angeles, Meghan said the events had been "devastating".
She also recalled living through race riots in 1992 and spoke of her regret that nothing appeared to have changed.
In her video message, Meghan called on young people and students at the school to come together to rebuild society.
In the video of her virtual address to Immaculate Heart High School, the duchess said she was "nervous" about addressing graduates and speaking about events of the previous weeks.
But she said that she "realised the only wrong thing to say is nothing because George Floyd's life mattered", before referring to other African-Americans who died in police shootings in the US in recent years.
In the video, which was first reported by the African-American female magazine Essence, Meghan also gave a heartfelt apology to the graduating students "that we have not gotten the world to the place that you deserve it to be".
She went on to highlight that people are "standing in solidarity" despite the unrest, and appealed to young people to "be part of this movement".
The Duke and Duchess of Sussex are now living in Los Angeles with their one-year-old son Archie, after stepping back as working members of the Royal Family.
- Reuters / BBC