Four people, including an NYPD officer, were shot at a train station in Brooklyn Sunday afternoon, officials said.

Police said the incident happened around 3 p.m. at the Sutter Avenue L train stop in Brownsville. Two officers confronted a man who did not pay his fare, repeatedly asking him to stop.

Chief of Department Jeffrey Maddrey said the man muttered the words, "I'm going to kill you if you don't stop bothering me."

The two officers became aware the man had a knife in his pocket and repeatedly asked him to take his hands out of his pockets. He refused, and the confrontation moved onto an incoming northbound L train, the NYPD said.

Both officers attempted to deploy their tasers on the man and both were ineffective. The man moved back onto the platform before advancing at one of the officers with his knife, Maddrey said.

At that point, both officers fired multiple rounds at the man, striking him in the abdomen area numerous times. One of the officers was struck under his left armpit and may have wounds from schrapnel as well but is expected to make a full recovery, police said.

Two civilians who were on the train, a man and woman, were each hit by police gunfire. The woman was grazed, but the man was struck in the head, Maddrey said.

Police said a full investigation will be conducted into the incident, which was caught on cameras in the subway car.

Mayor Eric Adams said the man who advanced on the officers had more than 20 arrests, and Maddrey said he had a significant history of mental illness.

In his first public appearance, the new interim NYPD Commissioner Thomas Donlon said the incident is another reminder that policing is a dangerous job.

"In my 30 years of law enforcement, I've learned that policing is a very, very difficult job," Donlon said. "We will be working through the timeline of today, but make no mistake, the events that occurred at the Sutter Avenue station platform were the results of an armed perpetrator."