New York - The two New York City police officers who were ambushed and shot to death in their vehicle Saturday were "quite simply, assassinated," and the suspect had made Instagram posts that were very anti-police, the police commissioner said.William Bratton said the officers, Liu Wenjin and Raphael Ramos, were shot in the head without warning after the gunman approached the passenger window of a marked police car and opened fire.The suspect, 28-year-old Ismaaiyl Brinsley, then ran inside a Brooklyn subway station and fatally shot himself in the head. Brinsley was black; the officers were Asian and Hispanic, police said.Bratton said the suspect shot and wounded his ex-girlfriend earlier on Saturday in Baltimore and made posts from her Instagram account. "This may be my final post," said one that included an image of a silver handgun. The post had more than 200 likes.Two officials told The Associated Press that the suspect posted about shooting two "pigs" in retaliation for the death of Eric Garner: "I'm putting wings on pigs today. They take 1 of ours, let's take 2 of theirs." He used the hashtags Shootthepolice RIPErivGardner (sic) RIPMikeBrown. The officials spoke on condition of anonymity because they were not authorised to speak publicly.The shooting occurred hours later, around the time that Bratton said that New York police were receiving a warning fax from Baltimore authorities.US Attorney General Eric Holder called Saturday's shooting deaths an "unspeakable act of barbarism." President Barack Obama was briefed on the shooting, the White House said.Officers in New York City's police department, the largest in the country, are being criticised for their tactics following the recent chokehold death of Garner, an unarmed black man who was stopped by police 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.Demonstrators around the country have staged protests since a grand jury decided on December 3 not to indict the officer in Garner's death. The decision closely followed a Missouri grand jury's decision not to indict a white officer in the fatal shooting of Michael Brown, an unarmed black 18-year-old.Bratton said they were looking at whether the suspect had attended any rallies or demonstrations.The Reverend Al Sharpton, a civil rights activist, 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.The last shooting death of a New York Police Department officer came in December 2011, after a report of a break-in at a Brooklyn apartment.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.Associated Press writer Jonathan Lemire contributed to this report.