NEW YORK (CNN) -- Two New York City police officers were shot and killed ambush-style Saturday afternoon as they sat in their patrol car in Brooklyn, Police Commissioner William Bratton said.
The gunman approached the passenger side of the patrol car and opened fire several times, fatally wounding officers Wenjian Liu and Rafael Ramos, authorities said at an evening press conference.
They were "shot and killed with no warning, no provocation," Bratton told reporters. "They were quite simply, assassinated."
Both were shot in the head, Bratton said.
The families of the fallen officers rushed to Woodhull Medical Center on Saturday, as dozens of police officers gathered in a show of support.
The officers -- one with two years' experience, the other with seven years on the job -- were normally assigned to downtown Brooklyn, but were working a "critical response" detail in an area with higher crime, police said.
Police identified the shooter as Ismaaiyl Brinsley. He was found dead in a nearby subway station from a self-inflicted gunshot wound.
The gunman arrived in New York from Baltimore, but had a residence in Atlanta, Bratton said.
Police were investigating posts he allegedly made on social media.
The shooting occurred near Myrtle and Tompkins avenues in the Bedford-Stuyvesant section of Brooklyn.
U.S. Attorney General Eric Holder called the attack "an unspeakable act of barbarism."
Neighborhood residents were jolted.
"This can't happen. If you mad at somebody, be mad at the person that you are mad at. Now, we have two families that (are) missing somebody for the holidays," Shaniqua Pervis told CNN affiliate WABC.
"Where is your humanity? I know it's a war going on and shoutout to Eric Garner's family and everybody else who lost somebody, but you're not at his house, on his lawn. This is two (officers). You don't even know if (they were) good or bad. I don't condone this, and I'm not with it."
The woman was referring to the controversial July death of an unarmed black man after New York police officers on Staten Island wrestled him to the ground, with one of the officers wrapping his arm around Garner's neck in a chokehold.
A grand jury's decision not to indict the police officer in the Garner case, as well as a separate grand jury's refusal to indict an officer in a controversial police shooting of unarmed teen Michael Brown in Ferguson, Missouri, led to nationwide protests against the police.
In a statement, activist the Rev. Al Sharpton said the Garner family was outraged by news of the shootings.
"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," the statement 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 Garner family and I have always stressed that we do not believe that all police are bad, in fact we have stressed that most police are not bad."
Last Saturday, two New York officers were assaulted on the Brooklyn Bridge during demonstrations that have been mostly peaceful. Police arrested four people.
Tensions between the community and police have heightened around the country since the Brown and Garner deaths.
"This could not have come at a worse time," City Councilman Robert Cornegy told CNN affiliate PIX.
So far, police have not commented on the motive for the Brooklyn shootings, except to say the officers were not engaging the shooter in any way when they were shot.
The city's police union and Mayor Bill de Blasio have sparred over the treatment of officers.
The Patrolmen's Benevolent Association recently sent a form for members to sign requesting the mayor not attend funerals of anyone killed in the line of duty, accusing de Blasio of "consistent refusal to show police officers the support and respect they deserve."
The mayor's office expressed disappointment with the PBA.
"Incendiary rhetoric like this serves only to divide the city, and New Yorkers reject these tactics," the city said in a letter. "The mayor and the speaker both know better than to think this inappropriate stunt represents the views of the majority of police officers and their families."
***Check back with Fox 8 for updates***