An NYPD sergeant shot a knife-wielding father of two at a Lower East Side housing project early Tuesday when the suspect refused to drop the weapon, cops said.

The shooting happened after cops got a call for an emotionally disturbed man, identified by sources as Julian DeJesus, 25, inside one of the buildings at the Jacob Riis II Houses along the FDR Drive around 12:30 a.m., cops said.

DeJesus’ girlfriend’s family members called 911 when DeJesus showed up shouting outside their second-floor apartment at the Jacod Riis II Houses, witnesses said.

“I was sitting around watching TV when I heard a voice that said ‘f—k,’” the girlfriend’s brother, who refused to give his name, told The Post. “He was at my sister’s window and he just got crazy.”

By the time responding cops Sgt. Carlos Roberts and Officer Ercan Tutku arrived, DeJesus had fled to his grandmother’s apartment inside another building at the complex, sources said.

Roberts and Tutku rushed up to the seventh floor where they heard a loud commotion and saw DeJesus standing in the doorway to the grandmother’s apartment brandishing a knife with a seven inch blade.

The cops repeatedly told him to put down the weapon, but DeJesus refused to comply.

“[DeJesus] advanced towards the officer in a threatening manner,” an NYPD spokesman said.

That’s when the Sgt. Roberts fired one shot that struck the man in the chest, sources said.

DeJesus’ girlfriend’s brother, who described DeJesus as “volatile” said, “he didn’t seem normal to me so I don’t know what he was doing,” he said. “He was just a nut job. He was just a maniac.”

He would often frequent between his girlfriend’s apartment and his grandmother’s apartment.

“There was a commotion,” said a 52-year-old neighbor who heard the gunshot. “I heard someone saying, ‘No, no’ and then he got shot.”

The neighbor, who asked not to be named, said DeJesus’ distraught grandmother was home at the time of the shooting.

“It was only a matter of time” the neighbor said. “The [cops] know him. He is a problem child. He deals drugs. He gets high. He’s got no job. He’s got no education.”

DeJesus was taken to Bellevue Hospital where he was listed in stable condition. Two officers were taken to Beth Israel Hospital for evaluation but were not injured.

Neighbors suspected that DeJesus, who identifies himself as a “rapper/singer” on his Instagram account called @BabyBottleGordo, was high on drugs.

“I heard he had been smoking dust,” said Liz Williams, 33. “He lost a lot of weight. He used to be chunky. We called him Gordo.”

DeJesus has 13 prior arrests for offenses like assault, robbery, drug and weapon possession, tampering with evidence, resisting arrest and escaping from a detention facility, sources said.

His girlfriend, who he shares two children with, defended him.

“He is not the monster everybody is trying to make him out to be,” said the girlfriend, who refused to give her name.

“He is a very good father. He is a very good father and a very good boyfriend,” she said. “He wasn’t trying to kill me or my kids. It’s completely false.”