Police shot a man who advanced at them with a knife early Wednesday morning in the Bronx, the NYPD said.

Two uniformed housing officers patrolling the Throgs Neck Houses saw Carlos Colon, 25, running and holding his side, which led them to believe he had a weapon, Assistant Chief Larry Nikunen said. When the officers told Colon to stop, he ran into 2755 Dewey Avenue, Nikunen said. Officers caught up to him on the seventh floor of the building.

Nikunen said Colon was holding a knife and threatening to kill himself.

A 45th Precinct plainclothes sergeant, who had responded to the officers’ call for assistance, shot a taser at Colon, Nikunen said.

Colon did not drop the knife and advanced toward the officers, police said. That’s when one of the uniformed housing officers shot him once in the upper right thigh, Nikunen said.

Colon still did not drop the knife, so the sergeant shot him a second time with the taser, Nikunen said. Police were then able to place him into custody.

Colon was taken to Jacobi Medical Center in stable condition, police said. No officers were hurt in the incident.