Updated

A police union says the men and women of New York City’s finest are now “declaring war” on Mayor Bill de Blasio following a pair of shootings targeting officers in the Bronx over the weekend.

The fiery rhetoric directed at the Big Apple’s Democrat leader -- who has implemented several measures critics say are hostile to police – comes as the NYPD filed charges against suspect Robert Williams in both attacks.

“Mayor De Blasio, the members of the NYPD are declaring war on you!” the Sergeants Benevolent Association wrote in a tweet. “We do not respect you, DO NOT visit us in hospitals. You sold the NYPD to the vile creatures, the 1% who hate cops but vote for you.

“NYPD cops have been assassinated because of you,” the tweet added. “This isn’t over, Game on!”

New York City police officers work the scene of a police-involved shooting outside the 41st precinct on Sunday. (AP)

BRONX ATTACKS ON NYPD LIKELY TO FURTHER INFLAME TENSIONS BETWEEN COPS, DE BLASIO'S CITY HALL

Police say Williams first ambushed two officers from the 41st Precinct on Saturday night, who had been sitting in a marked patrol van. One officer was wounded as a result of that attack when a bullet grazed his chin and neck.

Williams then walked into the precinct’s station house the next morning and opened fire with a 9mm handgun, injuring a lieutenant, police added. Only after running out of bullets did the 45-year-old Bronx native lay down on the ground and surrender.

The two officers wounded in the attacks have been treated and released from New York City hospitals.

Williams, meanwhile, has been charged with attempted murder, criminal possession of a weapon and resisting arrest.

De Blasio’s office ripped Sergeants Benevolent Association President Ed Mullins on Monday, telling Fox News that his "comments are absolutely reprehensible.

"He clearly has forgotten his oath to protect and serve," spokesperson Freddi Goldstein said. "While he threatens violence, the mayor remains focused on the safety of our officers and communities.”

ERIC TRUMP ON ATTACKS ON NYC OFFICERS: DE BLASIO DOESN'T STAND WITH POLICE

NYPD Chief of Department Terence Monahan also took a swipe at Mullins, telling Pix 11 in an interview that "none of the other unions follow his lead.

"The men and women that are out on the street right now, they care about keeping people safe. They care about keeping themselves safe," Monahan added. "And that's what this is about. This isn't politics. This isn't grandstanding."

De Blasio himself, in a series of tweets Sunday, hailed the “heroism and extraordinary skill” of the NYPD’s officers for de-escalating the situation.

“This vicious assassination attempt is the second one we’ve seen in 24 hours — and an attack on our NYPD officers is an attack on ALL New Yorkers,” he said. “This despicable hatred is an attempt to divide our city and undermine our safety. We cannot and will not let that happen.”

GUNMAN WHO TARGETED NYPD OFFICERS HAS VIOLENT PAST, POLICE SAY

The charges filed against Williams add to his already lengthy rap sheet, which the NYPD tells Fox News includes prior arrests dating back to 1994 for crimes such as robbery and criminal trespass.

Police Commissioner Dermot Shea said Sunday that Williams also had been paroled in 2017 after an attempted murder conviction in 2002.

In that incident, Williams shot a 23-year-old man several times in the back and leg before carjacking a 30-year-old woman’s vehicle, the NYPD tells Fox News. His bid to escape came to an end when he crashed the car and traded gunfire with New York City police officers, Shea noted.

Since his parole more than two years ago, Williams has one recorded arrest – a 2018 case of resisting arrest -- for which he was already scheduled to appear in court, the commissioner added. Williams has an arraignment hearing in Bronx Criminal Court for the latest incidents this afternoon.

"It is a double miracle that we are not preparing for two funerals right now," New York City Police Benevolent Association President Patrick Lynch said in a statement following the weekend shootings. "These targeted attacks are exactly what we have warned against, again and again. The hatred and violence directed at cops continues to grow.”

Police say Williams first ambushed two officers from the 41st Precinct on Saturday night, who had been sitting in a marked patrol van.

DAN BONGINO ON ATTACKS ON NYPD OFFICERS IN THE BRONX: 'I HAVE NEVER SEEN ANYTHING LIKE THIS'

Williams' grandmother, in an interview with the New York Post on Sunday, said he was "depressed at times because his son got shot in the street" in 2018.

The newspaper, citing police records, reported that an 18-year-old Robert Williams died in the Bronx that year in what officials classified as an accidental shooting that happened while the teen was playing with a friend's gun.

“That was his only child,” Mary Williams said.

When asked by New York Post if she has a message for her grandson now, Williams said she would "tell him to get his life straight and don’t [do] things like that, because I love him and God loves him.”

The motive for this past weekend's shootings is unclear, but Shea on Sunday criticized criminal justice reform activists who have demonstrated in recent months against excessive force by police, including a large protest in Grand Central Terminal. The protests, he suggested, helped create an anti-police environment.

“These things are not unrelated. We had people marching through the streets of New York City recently,” Shea said. “Words matter. And words affect people's behavior.”

Williams walked into this precinct station house the Sunday morning and opened fire with a 9mm handgun, injuring a lieutenant, police say. (AP)

2 ARKANSAS POLICE OFFICERS WOUNDED IN WALMART SHOOTING, SUSPECT SHOT

Yet, Shea didn't offer any evidence that Williams knew of those protests or was influenced by them.

De Blasio, who won office partly on a promise to reform policing of minority communities, also suggested that anti-police sentiment had gotten out of hand.

“Anyone who spews hatred at our officers is aiding and abetting this kind of atmosphere; it is not acceptable," he said. “You could protest for whatever you believe in, but you cannot vilely attack those who are here to protect us. It creates this kind of dynamic.”

The weekend attacks recalled other unprovoked assaults on New York City police officers sitting in their patrol vehicles.

New York Police Department Lt. Jose Gautreaux, who was shot in the arm by a gunman who opened fire in a police precinct in the Bronx, waves to his colleagues as he is released from Lincoln Hospital in the Bronx on Monday. (AP)

In 2017, a gunman killed Officer Miosotis Familia as she sat in her patrol vehicle in the Bronx. In 2014, two officers, Rafael Ramos and Wenjian Liu, were shot dead in their patrol car in Brooklyn by a man upset about recent police killings of unarmed black men.

The killings of Ramos and Liu had also followed large protests. Some officers blamed de Blasio for expressing solidarity with the demonstrations and turned their backs on the Democrat at the funerals.

CLICK HERE TO GET THE FOX NEWS APP

“Every time there is a funeral, the mayor shows up and guess what happens, every single officer turns around 180 and turns their back to the mayor of this city,” Eric Trump, the executive vice president of the Trump Organization, told 'Fox & Friends' on Monday.

"He's been so anti-law enforcement, and it shows," Trump added. "He doesn't stand with the men and women out there. He just doesn't."

Fox News’ Greg Wilson, Tamara Gitt, Stephen Sorace, and the Associated Press contributed to this report.