It happened on West 8th Street outside the DMV, just feet from the 60th Precinct in Coney Island around 1 p.m.
Police say a responding officer went to investigate a dispute over parking and approached a man, who was armed with thick red gloves and two knives, one of which was about 16 inches long.
That's when the 57-year-old suspect began to rush at the officer with one of the knives.
NYPD Commissioner Keechant Sewell said the officer was able to put distance between himself and the suspect until nearby officers jumped in to help.
The armed suspect then began to approach the other officers, who told the man to drop his weapons.
Police say the man continued to charge and that's when one of the officers fired four shots, striking the suspect in the leg and shoulder.
Despite being injured, the suspect continued to fight and refused to release his grip on the knives.
In the struggle, one of the officers, a 6-year veteran of the NYPD department, was sliced in the hand.
The officer went to Coney Island Hospital, where he was released in front of a large crowd of people on Thursday night.
The suspect was taken to Lutheran Medical Center.
"I was just in my house and watching TV with my dad and I heard gunshots," witness Amen Boyd said.
A knife was spotted lying on the sidewalk at the scene.
Citizen App captured video of the scene.
Police said the incident was caught on video, including police body cameras.
Both the officer and the suspect have non-life-threatening injuries.
ALSO READ | Connecticut Senate approved bill that protects abortion providers
* More Brooklyn news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube