NEW YORK (AP) -- The warning came just moments too late: A man who had shot his ex-girlfriend a few hours earlier had traveled to New York City and vowed online to shoot two "pigs" in retaliation for the police chokehold death of Eric Garner.

Minutes before a wanted poster for Ismaaiyl Brinsley arrived in the NYPD's Real Time Crime Center, he ambushed two officers in their patrol car in broad daylight, fatally shooting them before killing himself inside a subway station.

Brinsley, 28, wrote on an Instagram account before Saturday's shootings: "I'm putting wings on pigs today. They take 1 of ours, let's take 2 of theirs," two city officials with direct knowledge of the case confirmed for The Associated Press. He used the hashtags Shootthepolice RIPErivGardner (sic) RIPMikeBrown - references to the two police-involved deaths of blacks that have sparked racially charged protests across the country.

The officials, a senior city official and a law enforcement official, were not authorized to speak publicly on the topic and spoke on condition of anonymity.

Police said Brinsley approached the passenger window of a marked police car and opened fire, striking Officers Rafael Ramos and Wenjian Liu in the head. Brinsley was black; the officers were Asian and Hispanic, police said. The officers were on special patrol doing crime reduction work in the Bedford-Stuyvesant section of Brooklyn.

"They were, quite simply, assassinated - targeted for their uniform," said Police Commissioner Bill Bratton, who looked pale and shaken at a hospital news conference.

The sudden and extraordinary violence stunned the city, prompted a response from a vacationing President Barack Obama and escalated weeks of simmering ill will between police and their critics following grand jury decisions not to indict officers in the deaths of Garner in New York and Michael Brown in Missouri. The New York police union head declared there's "blood on the hands" of protesters and the city's mayor.

The Rev. Al Sharpton said Garner's family has no connection to the suspect and denounced the violence. He also said there is no place for angry rhetoric that blames protesters or New York City Mayor Bill de Blasio.

"We are now under intense threat from those who are misguided," he said. "From those who are trying to blame everyone from civil rights leaders to the mayor rather than deal with an ugly spirit that all of us need to fight."

Sharpton told The Associated Press that he's considering tightening his personal security after receiving nine messages threatening him - all within hours of the shooting.

More From KROC-AM