A gunman has been charged after terrorizing the New York Police Department twice in 12 hours, firing upon and wounding uniformed officers stationed in the Bronx in separate attacks that officials have condemned as assassination attempts.

One officer was shot in the neck and chin Saturday night when the gunman fired several rounds into a marked police van and fled, authorities said. At 7 a.m. Sunday, police said, the same man walked into the Bronx precinct headquarters and opened fire again, striking a lieutenant in the arm and surrendering after his 9mm handgun ran out of bullets.

Police identified the suspect as 45-year-old Robert Williams. He was being charged with attempted murder, criminal weapon possession and resisting arrest, they said.

At a news conference Sunday, Police Commissioner Dermot Shea said the alleged shooter has a “lengthy violent criminal history.” He was paroled in 2017 after serving more than a decade in prison on an attempted murder charge, Shea said.

The suspect’s grandmother told the New York Post he was upset following the death of his son, who she said was fatally shot.

“He was depressed at times because his son got shot in the street,” Mary Williams, 80, told the publication. “That was his only child.”

Mary Williams told CBS New York in an interview that she “couldn’t believe” the news.

“When I left here, he walked me to the door, he hugged and kissed me and said, ‘Grandma, I love you. I’ll see you tomorrow,’ and I said, 'Okay, I’ll see you tomorrow,” she said. “You don’t feel like your grandkid could do things like that, but when you look at something you’re just really shocked. You’ve got to really come back, get a grip on yourself and come back to reality."

The commissioner called the gunman a “coward,” linking the shootings to what he characterized as anti-law-enforcement rhetoric at a demonstration earlier this month that drew hundreds to Grand Central Terminal.

“Words matter,” Shea said. “By the grace of God we’re not planning a funeral.”

Both wounded officers were treated at Lincoln Medical and Mental Health Center in the Bronx and are expected to fully recover. The officer shot in the first attack, Paul Stroffolino, was released from the hospital on Sunday, exiting to salutes from fellow officers in uniform. He wore a bandage on his neck and gave a thumbs up to the crowd.

The attacks were a grim reminder of past shootings in the city in which officers did not survive, the commissioner said.

The shootings prompted the New York City Department of Correction to issue a letter warning corrections officers not to wear uniforms or other identifiable apparel when they are off duty and on public transportation, the New York Post reported. “Advise loved ones and friends to refrain from wearing clothing items or carrying items brandishing the department name and logo, for their safety,” Department Chief Hazel Jennings wrote.

In a statement, Gov. Andrew M. Cuomo (D) promised to hold the shooter accountable to the “fullest extent of the law.” Emphatically placing his support behind the NYPD, Mayor Bill de Blasio (D) said the shootings were meant to “divide” the city.

“This was an attempt to assassinate police officers. We need to use that word because it was a premeditated effort to kill,” de Blasio said. “And not just to kill other human beings, but to kill those who wear a uniform that represents all of us.”

By Sunday morning, President Trump had weighed in, using the shootings to admonish de Blasio and Cuomo, both prominent Democrats and critics of the president.

“I grew up in New York City and, over many years, got to watch how GREAT NYC’s ‘Finest’ are,” Trump tweeted. “Now, because of weak leadership at Governor & Mayor, stand away (water thrown at them) regulations, and lack of support, our wonderful NYC police are under assault. Stop this now!”

Cuomo’s spokeswoman, Dani Lever, later responded on Twitter. “We’d think politicizing police shootings would be beyond the pale even for @realDonaldTrump, but apparently there’s nothing too low for him,” she wrote.

The first attack happened about 8:30 p.m. Saturday, when a man who appeared to be in his 20s or 30s approached a marked police van with its emergency lights flashing. The two officers inside, longtime partners and friends since middle school, had been assigned to the area after a recent shooting and reports of drug activity.

The man asked for directions, Shea said, and then “without provocation” pulled out a gun. The man fired several shots, which struck the neck and chin of the officer in the driver’s seat, narrowly missing his carotid artery.

Neither officer returned fire.

The next morning, just before 8 a.m., the stillness of the 41st Precinct in the Bronx was shattered when a man walked inside and “immediately” pulled out a gun, Shea said.

According to surveillance footage from inside the precinct and witness accounts, he fired multiple rounds toward a desk area staffed by uniformed officers. A male lieutenant with about 15 years on the force was struck in the arm.

The gunman then walked to an area beside the desks and fired several more rounds at “point-blank range” at more uniformed officers and a civilian member of the NYPD. No one else was hurt.

Surveillance footage posted on social media shows an officer ducking for cover. Seconds later, a man is seen falling to the ground. A handgun slides across the floor, then officers swarm him.

“It is only by the grace of God and the heroic actions of those inside the building that took him into custody that we are not talking about police officers murdered inside a New York City police precinct,” Shea said.

The commissioner said the police department will evaluate protocols dictating precinct security to determine whether they should be strengthened to ensure officer safety. Precincts must be secure while facilitating an engaging atmosphere so citizens feel comfortable seeking help.

“That’s the balance we strike,” Shea said.

Read more: