A Maryland sheriff’s deputy working on a U.S. Marshals Service task force fatally shot a man Wednesday after officials said the man charged at officers while armed with a large knife.

Montgomery County Sheriff Darren Popkin said the man came out of the window of a Gaithersburg home brandishing a knife, The Washington Post reported. One officer used a stun gun, but it did not knock him down, Popkin said. The deputy was "backing up" but the man got "very close," causing the deputy to fear for his life and fire his weapon, the sheriff said.

The man was fatally injured and a second man who was hit was treated at a hospital, the Independent Investigations Division of the Maryland Office of the Attorney General said in a statement.

NEW JERSEY MAN IS SENTENCED FOR SENDING THREATENING MESSAGES TO A BLACK MARYLAND WOMAN

Baltimore, Annapolis, Ocean City news

A Maryland sheriff's deputy fatally shot a man who charged him with a knife.

The deputy who fired was working as part of the Capital Area Regional Fugitive Task Force, run by the U.S. Marshals Service, which does not equip its officers with body-worn cameras, Popkin said.

MARYLAND DELI WORKER PEPPER SPRAYED, STABBED WHILE TRYING TO STOP THEFT OF TIP JAR: POLICE

Since the deputy is a deputized federal officer as a member of the task force, the FBI will investigate the shooting, according to Popkin and an FBI spokeswoman. The IID said it will conduct its own investigation.