Two police sergeants have been shot, one fatally, in an exchange of gunfire with a man suspected of breaking into a woman's home, authorities in New York said.
The gunman was also killed.
Governor Andrew Cuomo announced the New York Police Department sergeant's death, saying in a statement the officer had "made the ultimate sacrifice in the line of duty".
The other sergeant, who was shot in the leg, was undergoing treatment at a local hospital, said Mr Cuomo.
The gunman, Manuel Rosales, fired on officers who had stopped his car following a brief pursuit near a sports field, a law enforcement official said.
A woman who had an order of protection against Rosales had called 911 after he broke into her home and stayed for hours, giving police a description of his car, the official said.
Officers on patrol pursued Rosales, pulled him over and were attempting to arrest him when he opened fire, said the official.
News helicopter footage of the scene showed a red SUV mounted on a pavement pinned between a flat-bed truck and a police vehicle.
Resident Gary Mayo, a city worker, was home on a day off when he heard five or six booms.
"That doesn't sound like firecrackers," he said he thought.
From the terrace of his fourth-floor apartment he saw a swarm of police cars converging on a nearby street and could tell whatever happened was "something really big", he said.
Rosales, 35, was listed as homeless in court records from July. A lawyer who previously represented him said he was not violent.
The sergeant is the fifth New York Police Department officer to be fatally shot in the line of duty in the last two years.