A man armed with a machete was fatally shot by a police officer conducting a search warrant in the Bronx early Tuesday morning, the NYPD said.

Officers from the Emergency Service Unit had received information about guns and drugs inside a third-floor apartment in a building on Brook Avenue and East 138th Street in Mott Haven, Chief of Patrol Terence Monahan said at a news conference.

When they entered the railroad apartment at about 4:10 a.m., two of the officers went to the rear bedroom where they encountered Mario Sanabria, 69, holding a “machete-type sword with a 2-foot blade,” Monahan said.

The officers told Sanabria to drop the knife, but he did not comply.

“As the subject continued to approach the lead officer, the officer discharged one shot from his service firearm, striking the subject once in the chest,” Monahan said.

Sanabria was taken to NYC Health + Hospitals/Lincoln Hospital where he was pronounced dead, police said.

A sergeant who was not in the rear bedroom had a stun gun, or Taser, but the lead officer who fired at the man did not, Monahan said.

According to NYPD policy, all ESU members carry Tasers, a representative said. It was not clear why the officer involved in the shooting was not carrying one at the time, and a request for further comment was not immediately answered.

ESU officers also do not currently have body cameras, Monahan said.

Sanabria lived in the apartment, according to a law enforcement source, but he was not the man cops were looking for. That individual was detained outside of the building and brought in for questioning shortly after the shooting, Monahan said.

There was a second man in the apartment who was not injured, and no officers were hurt, police said.

The machete was recovered at the scene, police said.

With Lauren Cook