An NYPD officer shot a man who allegedly charged at cops with two knives, slicing one in the thumb, during a dispute in Coney Island Thursday afternoon.

The 57-year-old suspect was first spotted blocking traffic outside the Coney Island DMV, steps from the boardwalk, just before 1 p.m. He wore thick red gloves, police said, and carried a 16-inch machete and a six-inch blade.

When officers called on him to drop the weapons, NYPD Commissioner Keechant Sewell said he refused and instead lunged at the cops. One of the officers then fired four shots at him, striking him in the leg and shoulder.

An “intense, prolonged struggle” broke out, Sewell added, as officers attempted to remove one of the knives from the man’s hand. It was during that scuffle that one of the officers suffered a slashing wound to the thumb. Both the alleged stabber and the officer were hospitalized in stable condition.

One witness told Gothamist that more than a dozen officers from the nearby precinct rushed at the man shortly after he was shot.

"I heard the shots and immediately looked outside and started filming," said the witness, who requested anonymity for fear of police retaliation. "The entire police precinct descended upon this guy."

Video taken by the witness showed two officers attempting to take an individual into custody on the sidewalk. When one of the officers called for backup, more than a dozen cops arrived at the scene, surrounding the man as he was lying on the ground. At one point, one of the officers appeared to kick and stomp at the individual.

The video then shows an officer emerge from the struggle with what appears to be a large knife. He initially crouched on the ground before collapsing, as a gaggle of officers quickly surrounded him.

Ambulances arrived soon after, and a man who appeared to be handcuffed is placed on a stretcher.

A motive for the attack is not yet known, police said.

This story has been updated with additional information. Jen Chung contributed reporting.