Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An on-duty U.S. Immigration and Customs Enforcement agent shot a man in the face during an arrest at a Brooklyn, New York, home Thursday morning, according to ICE and law enforcement sources.

A New York City Police Department public information officer told NBC News that the man who was shot was taken to the hospital and expected to survive.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Another man in the Bensonhurst home had barricaded himself, but eventually surrendered to officers, the officer said. It's unclear if the man had barricaded himself before or after the ICE agent arrived.

Two ICE officers were also hospitalized for treatment, an ICE spokesperson said in a statement.

The statement said an officer with ICE's Fugitive Operations Team "discharged at least one firearm ... when officers were physically attacked while attempting to arrest Gasper Avendando-Hernandez, a twice-removed illegal alien from Mexico with a 2011 assault conviction in New York City."

Avendando-Hernandez had been arrested on Feb. 3 for allegedly possessing a forged instrument, a felony, but he was released from custody before ICE could put a hold on him.

"This forced ICE officers to locate him on the streets of New York rather than in the safe confines of a jail," the ICE statement said.

Avendando-Hernandez and an unidentified individual were in ICE custody Thursday.