NEW YORK (CNN) -- The cop-killer didn't seem to have a specific target -- just any two officers in uniform.
And on the day of his deadly attack, those officers just happened to be Wenjian Liu and Rafael Ramos.
While patrolling a Brooklyn neighborhood Saturday, the New York police officers were killed by the man who had also just shot his ex-girlfriend -- and apparently broadcast his intention to kill police on social media.
Here's what we know about the shooting, the victims and the latest threats against police:
Liu and Ramos were sitting in their patrol car in a high-crime part of Brooklyn when -- without warning -- the gunman shot them in the head.
"They were, quite simply, assassinated," New York City Police Commissioner William Bratton said.
Tantania Alexander, the first emergency medical technician on the scene, became emotional when she described looking into the patrol car.
"He has a family," Alexander remembers thinking. "You don't know if he's going to go ... you put your life on the line every day for people."
Police said the shooter was 28-year-old Ismaaiyl Brinsley. Hours before he killed Liu and Ramos, Brinsley shot his ex-girlfriend near Baltimore. The woman, 29-year-old Shaneka Nicole Thompson, was shot in the stomach but survived.
A series of social media posts believed to be from Brinsley gave ominous clues that police would be next.
It was one of the ex-girlfriend's friends who alerted Baltimore County Police to troubling Instagram posts that the friend believed came from Brinsley.
"These posts included overt threats to kill police officers," police said. And they appeared to be posted in Brooklyn, New York.
"I'm Putting Wings On Pigs Today," one Instagram post read, according to police. "They Take 1 Of Ours, Let's Take 2 of Theirs."
Brinsley also posted messages of self-loathing and despair and made reference online to Michael Brown and Eric Garner, black men who were killed by police.
Around 2:10 p.m., 40 minutes after speaking with the friend, Baltimore County police said they called New York police to warn them. Then they faxed a "wanted" poster with Brinsley's picture.
"Suspect is armed with a 9mm handgun and has posted pictures on Instagram saying that he will shoot a police officer today," a description on the flier says.
But it was too late. New York Police Chief of Detectives Robert Boyce said while New York police were spreading the warning, Brinsley ambushed and killed the two officers.
Later, at a nearby subway station, Brinsley was found dead of a self-inflicted gunshot wound.
The officers' killings came after months of protests over the deaths of unarmed black men at the hands of police officers.
In July, New York City police officers wrestled Garner to the ground, with one officer wrapping his arm around Garner's neck in a chokehold. That officer was not indicted.
And in August, Brown was shot by a police officer in Ferguson, Missouri. That officer also was not indicted.
The deaths of Liu and Ramos sparked backlash and finger-pointing. Former New York Gov. George Pataki and some police union officials blasted New York Mayor Bill de Blasio. Pataki accused de Blasio of putting officers' lives at risk by supporting recent protests over the deaths of Garner and Brown.
De Blasio did not respond to the denunciations against him, but condemned the officers' "assassination."
Bratton sought to tamp down the anger on Monday.
Asked by NBC's "Today" whether de Blasio should apologize to police, Bratton said, "I don't know that an apology is necessary." The issue is "starting to shape up along partisan lines, which is unfortunate," he said. "This is something that should be bringing us all together, not taking us apart."
Bratton spoke positively of de Blasio, saying he has received an additional $400 million this year to improve training and equipment for police, including equipping every police officer with a smartphone.
Bratton compared the current tensions to what he saw in the 1970s when he first got into policing. "Who would have ever thought -- deja vu all over again -- that we'd be back where we were 40 years ago," Bratton said, adding that social media now spread the word quickly.
"We're in a change moment" in the United States, he said. The goal is to find opportunities to move forward.
Brown's family condemned Saturday's slayings.
"We reject any kind of violence directed toward members of law enforcement. It cannot be tolerated. We must work together to bring peace to our communities," the family said in a statement.
"Our thoughts and prayers go out to the officers' families during this incredibly difficult time."
The Rev. Al Sharpton -- who is also a target of criticism -- said the Garner family was outraged by the police officers' killings.
"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 new threats
As they grieve the deaths of two of their colleagues, New York police must also deal with a spate of new threats.
The NYPD is investigating more than 15 threats to officers posted on various social media platforms and trying to determine whether any are serious or credible, a senior New York City law enforcement officer told CNN.
The department's intelligence division continues to monitor social media for threats made to the NYPD. Officials have not released details about any potentially credible threats.
But the troubling messages aren't just coming from New York.
A Memphis, Tennessee, man has been questioned after allegedly posting threats against the NYPD, CNN affiliate WREG reported.
"Good job. Kill em all I'm on the way to NY now #shootthepolice 2 more going down tomorrow," an Instagram post read.
The NYPD has already pulled all of its auxiliary officers off the streets in the wake of the killings of the two officers. Auxiliary officers are unarmed volunteer officers who help with traffic control or other minor situations.
Both Liu and Ramos dreamed of being police officers, Bratton said.
Liu, 32, was a seven-year veteran and married just two months ago, WABC reported. Ramos, 40, joined the force two years ago after spending three years as a school safety officer. Ramos was married and has a 13-year-old son.
Ramos' teenage son, Jaden, posted a heartbreaking message on Facebook.
"Today is the worst day of my life," Jaden wrote.
"Today I had to say bye to my father. He was (there) for me everyday of my life, he was the best father I could ask for. It's horrible that someone gets shot dead just for being a police officer. Everyone says they hate cops but they are the people that they call for help. I will always love you and I will never forget you. RIP Dad."