Police responded to a series of 911 calls from a mother saying her daughter's boyfriend threatened to "shoot the place up."
While responding officers were talking with the daughter they say the man showed up and fired a shot.
The officer, part of the 77th Precinct, was shot in the back, but his protective vest stopped the bullet.
Officers started chasing the alleged shooter and fired at least seven shots but did not hit him. They did catch him arrested. He was arrested and the gun was recovered. His name was not immediately released.
Get breaking news alerts in the FOX5NY News app. Download for FREE!
The 27-year-old officer was taken to Kings County Hospital for treatment. The officer was released a short time later.
Police Commissioner Dermot Shea said in a late-night news conference "As the clock now turns to Christmas, I think we'll call this the Christmas miracle."
"Because an officer put himself in harm's way, an innocent woman is alive tonight," Mayor Bill de Blasio said at a news conference late in the evening on Thursday.