With the help of social media, it didn't take long for authorities to find evidence of the warped thinking of Ismaaiyl Brinsley, who assassinated two New York City Police Department officers in Brooklyn on Saturday.

Not only did Brinsley tell two bystanders to "watch what I'm gonna do" before opening fire on the officers, but he also apparently left an online trail of hate in which he said he planned to put "Wings On Pigs" and avenge the death of Eric Garner, who was killed in a confrontation with New York police. "They Take 1 of Ours, Let's Take 2 of Theirs," he reportedly posted on Instagram a few hours before killing officers Wenjian Liu and Rafael Ramos.

The deadly attack stunned a nation still struggling to come to terms with the 2014 police-involved deaths of Garner and Akai Gurley in New York, Michael Brown in Ferguson, Mo., and 12-year-old Tamir Rice in Cleveland.

One fundamental element of police-community relations that has received too little discussion amid the din of protests sparked by these cases is that law enforcement is an inherently dangerous profession. Brinsley's cowardly ambush provided a shocking reminder of that on Saturday.

Police "go to roll call every day thinking this type of thing is possible," Minneapolis police spokesman Scott Seroka told the Star Tribune on Sunday.

Indeed, the names Liu and Ramos will soon be engraved on the walls of the National Law Enforcement Officers Memorial in Washington, D.C. The memorial lists more than 20,000 sworn law enforcement officers who have been killed in the line of duty in the United States since 1791.

According to the FBI, 49,851 officers were assaulted while on duty in 2013, and 27 were killed in incidents involving felonies. Another 49 died in accidents while on duty.

Liu and Ramos were in their marked squad car in the Bedford-Stuyvesant section of Brooklyn when Brinsley approached them, providing easy targets for a man with mental health issues and a long history of violent behavior and run-ins with the police.

Brinsley, a high-school dropout who had shot an ex-girlfriend in the stomach earlier Saturday, killed the officers and then ran from the scene to a nearby subway station, where he took his own troubled life.

Those who were quick to blame Brinsley's actions solely on recent protests in New York and other cities must acknowledge his criminal past and reported mental instability. This was not an average 28-year-old New Yorker who was leading a productive life before last weekend.

Asked to comment on the ambush, Minneapolis police said they would not change any of their procedures. How could they? Officers must be accessible to the public, and while in uniform they can be targeted by any deranged person who emerges, armed and dangerous, from the general public they are sworn to serve.

In a Facebook tribute to the man he called "the best father I could ask for," 13-year-old Jaden Ramos innocently shared the pain he felt when he learned his dad was gone. "It's horrible that someone gets shot dead just for being a police officer," he wrote. "Everyone says they hate cops, but they are the people that they call for help."

The vast majority of those who have demonstrated for police accountability in recent months were no doubt horrified to learn about the deaths of Liu and Ramos.

They likely were similarly sickened by the circumstances that led to the Sunday death of officer Charles Kondek near Tampa, Fla. A fugitive shot Kondek and ran him over with his car before being arrested. Police said they did not believe the attack was related to the New York ambush.

The weekend incidents leave the nation on edge and in mourning as Christmas approaches. Hopefully, the holiday will provide all Americans with time for quiet, lawful reflection on the events of the past several months.

A fitting mantra was provided Sunday by Eric Adams, Brooklyn borough president. Adams, who is black, asked demonstrators to remember Liu and Ramos and to "send out a very clear and loud message: All lives matter."