A Brooklyn police lieutenant was slashed in the arm by “a crazy lady” with a kitchen knife near Prospect Park Monday morning, police sources and witnesses said.

Lieutenant Wojciech Niebrzydowski was called to an apartment building on 18th Street near Albemarle Road in Flatbush at 11:12 a.m. after a social worker reported that a woman living inside the building had “snapped” and wouldn’t let her inside, the sources said.

Niebrzydowski knocked on the door of the crazed woman’s fourth floor apartment — but she answered with a knife and lunged at him, slicing a gash in his left forearm, police sources said.

She came at him with such force, the blade broke and went flying across the hallway, landing on the linoleum floor and splattering it with blood, police sources said.

To subdue her, a second cop then Tasered her, police said. She was later hauled by ambulance to a psychiatric unit, the sources said.

“The lady was very aggressive. She was a crazy lady. She snapped,” said one resident, who also lives on the fourth floor.

She added, “I could see the officer walking to an ambulance with blood on his shirt. Officers with him also had blood on their hands.”

Other witnesses heard the woman shouting and saw a swarm of police vehicles, they said.

“The lady started screaming and came out with a kitchen knife and slashed his arm,” said a porter from the building, who saw the aftermath of the attack.

Another witness added, “I was outside, about to come into the office and I saw the ambulances and two big police vans. It was a pretty chaotic scene.”

Niebrzydowski, who has worked for the NYPD for more than 15 years, was rushed to Kings County Hospital in stable condition, according to cops.

The senseless attack is one example of sweeping national mental illness problem, Police Commissioner Bill Bratton said Monday.

“I don’t think it’s any secret that the issue of emotionally disturbed persons is a national crisis. It’s nothing unique to New York. Police have a role to play. We are not the solution. We’re part of it, but we’re not the solution. In this city, we’re fortunate in being very well funded to train our officers,” Bratton said.

Officers in New York City go through a four-day training on how to deal with emotionally disturbed and mentally ill people, he said.

“More frequently than not, we take them to the hospital. We don’t arrest them, we take them to the hospital and in a short period of time, they’re oftentimes released and back out into the streets again. It’s something that the mayor is clearly focused on,” Bratton said.

Niebrzydowski was recovering well on Monday afternoon, he said.

“It looks [like] the wound to his arm is such that he’s going to be treated and released and that’s good news that it doesn’t appear to be a serious injury,” Bratton said.

Niebrzydowski made the “captain’s list” last June, the 70th Precinct announced in a Tweet. He later passed a captain exam, according to NYPD Pulaski Association.