DHAKA: A gunman has shot dead two police officers sitting inside a patrol car in New York before killing himself.
The head of the New York police said the men had been "targeted for their uniform".
The gunman ran into a nearby subway station where he then shot himself, officials say, reports BBC.
Earlier, the attacker shot and injured his ex-girlfriend and had posted anti-police messages on social media.
The mayor of New York, Bill de Blasio, said anyone who saw postings indicating a threat to the police should report them to the authorities. The "whole city was in mourning" after the shootings, he said.
The shootings come at a time when New York city police are facing intense scrutiny for their tactics, the BBC's Samira Hussein reports from New York.
Earlier this month, a grand jury did not indict any New York police department officer in the chokehold death of Eric Garner, a black man who died when white police officers tried to arrest him for selling cigarettes.
The decision sparked protests in New York and other cities across the US.
BDST: 0842 HRS, DEC 20, 2014