NEW YORK (AP) -- A gunman who announced online that he was planning to shoot two "pigs" in retaliation for the police chokehold death of Eric Garner ambushed two officers in a patrol car and shot them to death in broad daylight Saturday before running to a subway station and killing himself, authorities said.
The suspect, 28-year-old Ismaaiyl Brinsley, wrote on an Instagram account: "I'm putting wings on pigs today. They take 1 of ours, let's take 2 of theirs," officials said. He used the hashtags Shootthepolice RIPErivGardner (sic) RIPMikeBrown.
Police said he approached the passenger window of a marked police car and opened fire, striking Officers Rafael Ramos and Wenjian Liu in the head. 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 William Bratton, who looked pale and shaken at a hospital news conference.
Brinsley took off running as officers pursued him down to a nearby subway station, where he shot himself in the head. A silver handgun was recovered at the scene, Bratton said.
"This may be my final post," he wrote in the Instagram post that included an image of a silver handgun.
Bratton confirmed that Brinsley made very serious "anti-police" statements online but did not get into specifics of the posts. He said they were trying to figure out why he had chosen to kill the officers. Two city officials with direct knowledge of the case confirmed the posts to The Associated Press. 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.
The Rev. Al Sharpton said Garner's family had no connection to the suspect and denounced the violence.
"Any use of the names of Eric Garner and Michael Brown in connection with any violence or killing of police, is reprehensible and against the pursuit of justice in both cases," Sharpton said. "We have stressed at every rally and march that anyone engaged in any violence is an enemy to the pursuit of justice for Eric Garner and Michael Brown."
The shootings come at a tense time. Police in New York are being criticized for their tactics following the July death of Garner, who was stopped on suspicion of selling loose, untaxed cigarettes. Amateur video captured an officer wrapping his arm around Garner's neck and wrestling him to the ground. Garner was heard gasping, "I can't breathe" before he lost consciousness and later died.
Demonstrators around the country have staged die-ins and other protests since a grand jury decided Dec. 3 not to indict the officer in Garner's death, a decision that closely followed a Missouri grand jury's refusal to indict a white officer in the fatal shooting of Brown, an unarmed black 18-year-old. Bratton said they were investigating whether the suspect had attended any rallies or demonstrations.
Brinsley was black; the officers were Asian and Hispanic, police said.
Mayor Bill de Blasio said the killing of the officers strikes at the heart of the city.
"Our city is in mourning. Our hearts are heavy," said de Blasio, who spoke softly with moist eyes. "It is an attack on all of us."
Scores of officers in uniform lined up three rows deep outside the hospital to honor the fallen police officers. The mayor ordered flags at half-staff.
In a statement Saturday night, Attorney General Eric Holder condemned the shooting deaths as senseless and "an unspeakable act of barbarism." President Barack Obama was also briefed on the shooting, and White House officials were monitoring the situation closely, the White House said.
Early Saturday, Bratton said, Brinsley went to the home of a former girlfriend in the Baltimore area and shot and wounded her. Police there said they noticed Brinsley posting to the woman's Instagram account about a threat to New York officers. Baltimore-area officials sent a warning to New York City police, who received it around the time of the shooting, Bratton said.
Criminal records show Brinsley has a history of arrests on various charges in Georgia, including robbery, shoplifting, carrying a concealed weapon, disorderly conduct and obstruction of a law enforcement officer. Bratton said his last-known address was Georgia, but he had some ties in Brooklyn.
A block from the shooting site, a line of about eight police officers stood with a German shepherd blocking the taped-off street. Officer Ramos was married with a 13-year-old son, police said. He had been on the job since 2012. Liu had been on the job for seven years and got married two months ago, Bratton said.
"Both officers paid the ultimate sacrifice today while protecting the communities they serve," he said.
The president of the police officers union, Patrick Lynch, and de Blasio have been locked in a public battle over treatment of officers following the grand jury's decision. Just days ago, Lynch suggested police officers sign a petition that demanded the mayor not attend their funerals should they die on the job.
The last shooting death of an NYPD officer came in December 2011, when 22-year veteran Peter Figoski was shot in the face while responding to a report of a break-in at a Brooklyn apartment. The triggerman, Lamont Pride, was convicted of murder and sentenced in 2013 to 45 years to life in prison.