Cops shot and killed the knife-wielding resident of a Bronx homeless shelter Monday night after he stabbed two security guards there, police said.

Officers arrived at Urban Pathways on Hughes Avenue in the Belmont section of the borough at around 7:30 p.m. as the suspect was stabbing the guards, both women, according to law enforcement sources.

The attacker was identified as 68-year-old Cornell Lockhart, who had lived there for 11 years. He jumped over a counter to attack the two women, 48 and 29, a law enforcement source said.

Back in August, Lockhart had been reported as a missing person from the area, according to a tweet by the NYPD’s 48th Precinct station house.

Responding officers ordered him to drop the knife – at least 20 times, said NYPD Chief of Patrol Terence Monahan.

“The officers proceeded to give verbal commands to drop the knife,” he said. “The officers repeated these commands more than 20 times.”

When the suspect didn’t drop the knife, cops opened fire, according to police.

“The armed man did not comply and instead stepped towards the officers with the knife displayed in his right hand,” Monahan said.

“At that point both officers discharged their weapons striking the suspect multiple times.”

The suspect’s blade was described as four-inch-long kitchen knife.

“The knife can stab and kill a person like it may of almost done to one of these security guards,” Monahan said.

The woman stabbed in the chest was rushed in surgery, while the other was knifed in the arm law enforcement sources said.