This post has been updated.

Political figures clashed Sunday over the shooting death of two NYPD officers, with some blaming it partly on protests against police and others sharply rejecting the idea.

Critics of New York City Mayor Bill de Blasio (D) and President Obama claimed the two stoked hostility against law enforcement by empathizing with protesters who have bemoaned the deaths of Eric Garner and Michael Brown, two black men killed by police this year in New York and Missouri.

"We've had four months of propaganda — starting with the president — that everybody should hate the police," former New York City mayor Rudy Giuliani (R) said in an interview on "Fox and Friends Weekend." "I don't care how you want to describe it: That's what those protests are all about."

Authorities said the man who shot the officers on Saturday later took his own life.

Giuliani added that he thinks "it goes too far to blame" de Blasio for the deaths of the officers. But, he added, "I don't think it goes too far to say the mayor did not properly police the protests."

The authorities have identified the shooter as Ismaaiyl Brinsley. In advance of the deadly shooting, Brinsley took to social media to declare his intention to kill police officers in response to the killings of Brown and Garner.

Former NYPD commissioner Ray Kelly said on ABC's "This Week with George Stephanopoulos" that the backlash against de Blasio was fueled by comments the mayor made earlier this month about advising his son, who is half black, to take "special care" in encounters with police.

"I think that set off this latest firestorm. And, quite frankly, the mayor ran an anti-police campaign last year," Kelly said.

De Blasio faced more direct criticism from former New York governor George Pataki (R), who said Saturday on Twitter that he was “sickened by these barbaric acts, which sadly are a predictable outcome of divisive anti-cop rhetoric” of the mayor and Attorney General Eric Holder.

Asked about Pataki's tweet in an interview on CBS's "Face the Nation," Sen. Lindsey O. Graham (R-S.C.) said, "I blame the shooter and nobody else."

But he added, "I think the mayor of New York has probably undercut his cops and the attorney general is trying to walk a fine line."

Others defended de Blasio, arguing that he is trying to bridge divisions, not widen them.

"I think the tone that the mayor is trying to set is a tone that brings people together," Rep. Gregory Meeks (D-N.Y.) said on "This Week." He called comments made by Patrolmen's Benevolent Association President Patrick Lynch criticizing de Blasio "unfortunate."

"We stand with the police department. No one has ever given up on the police department or said we were anti-police department. What we were crying for was just saying how African Americans feel — how their communities are policed," the congressman said.

“There’s blood on many hands tonight," Lynch said Saturday, adding, “That blood on the hands starts at City Hall in the office of the mayor.”

Appearing on "Face the Nation," NAACP President Cornell William Brooks said Pataki's criticism was unjustified.

"To link the criminal insanity of a lone gunman to the peaceful protests and aspirations of many people across the country, including the attorney general, the mayor and even the president, is simply not fair," he said.

Brooklyn Borough President Eric Adams (D), a former police officer, concurred.

"Those who were calling for police reform were not calling for police retribution," he said on NBC's "Meet the Press," adding that "blood is not on the hands of the mayor."

Meeks called the killing of the officers a "heinous" act.

Some pols took to Twitter on Sunday to react to Saturday's violence.

Former senator Scott Brown (R-Mass.) said that in the wake of Saturday's violence, "it's time" for leaders to "unite" the country:

Some current members of Congress offered thoughts and prayers to the families of the slain NYPD officers:

At least a pair of lawmakers from Florida responded to the shooting death of a police officer in Tarpon Springs, Fla:

“Earlier today my wife and I were saddened to hear of the killing of Tarpon Springs police officer Charles Kondek, just hours after the nation was shocked by the horrific murder of two NYPD officers," Sen. Marco Rubio (R-Fla.) said in a statement. "These killings are stark and somber reminders of the risks our men and women in law enforcement take each and every day to keep us and our families safe."