(CNN) -- A New York Police Department officer who was shot in the back during a domestic violence incident in Brooklyn on Thursday was saved by his bulletproof vest, in what officials called a "Christmas miracle."
"On this Christmas Eve into Christmas, I would say that somebody is absolutely looking out for us here in the NYPD tonight," Mayor Bill de Blasio said.
The incident began before 9 p.m. when the NYPD received a series of 911 calls from a mother saying, "Get here quick, get here now. He's going to come over here and shoot the place up," according to NYPD Commissioner Dermot Shea. The mother was referring to her daughter's boyfriend, he said.
NYPD officers from the 77th Precinct arrived at the Crown Heights home and had begun interviewing the mother and daughter when the boyfriend pulled up to the home and opened fire, Shea said.
"You see incredible bravery by the officers," said Shea, who reviewed the body camera footage. "You see the girlfriend point out and next thing you hear is shots being fired."
One officer was struck in the back -- but the bulletproof vest kept the bullet from penetrating the officer, Shea said as he held up the vest.
Other officers responding to the incident saw the 20-year-old suspect fire his weapon, and two officers fired at least seven shots toward the suspect, Shea said. A short foot pursuit ensued, and officers were able to apprehend the suspect in the span of one to two blocks, he said. The man was not injured.
The suspect, William Moss, was arrested on Friday morning and charged with attempted murder, assault, criminal use of a firearm, criminal possession of a weapon and reckless endangerment.
CNN has been unable to identify an attorney for Moss.
Speaking at Kings County Hospital, de Blasio said the officer, whose name was not released, was treated for his injuries. He was released from the hospital early Friday morning, said NYPD Officer Jason Correa.
"Because the NYPD was there, that woman is alive right now," de Blasio said. "Because our officer put himself in harm's way -- an innocent woman is alive tonight."
The shooting is one example of a stunning rise in gun violence across the country that began in the late spring and has continued throughout the year.
In New York, the number of crimes this year is slightly down from last year, but murders have increased by nearly 40% and shooting incidents have doubled compared to 2019, according to NYPD data.
CNN's Mirna Alsharif contributed to this report.