Updated

Two agents from the U.S. Marshals Service were shot Friday morning in New York City while exchanging gunfire with at least one suspect, who was wanted for allegedly shooting a Massachusetts State Trooper and has died, officials said.

Shots rang out at approximately 5:30 a.m. in the area of Ely and Edenwald Avenues in the Bronx, officials confirmed to Fox News. 

The two marshals were injured in the confrontation in the Bronx but were in good condition, the agency said in a press release. 

Three marshals hunting for Sterling took fire as soon as they entered the Bronx home where they believed Sterling was located, a law enforcement official told The Associated Press.

New York Police officers block off the street near the scene where a suspect was killed during a shootout with U.S. marshals in the Bronx that left two officers wounded, Friday, Dec. 4, 2020, in New York. (AP Photo/Mark Lennihan)

New York Police officers block off the street near the scene where a suspect was killed during a shootout with U.S. marshals in the Bronx that left two officers wounded, Friday, Dec. 4, 2020, in New York. (AP Photo/Mark Lennihan)

"The task force was in the Wakefield section of the Bronx searching for Andre Sterling, 35, when the shootout began," the press release states. "Sterling died in the exchange."

The agency said one deputy marshal was struck in his arm and leg, while the second was struck in the leg.

DE BLASIO’S $1B NYPD CUT LEFT 2,500 HOMELESS COMPLAINTS UNANSWERED

Sterling was pronounced dead at the scene, officials said. His gun was recovered.

An FDNY spokesperson told Fox News the department received a report of five patients and that four people were transported to the hospital.

This poster, from the Massachusetts State Police Twitter page, posted Nov. 24, 2020, shows Andre K. Sterling. Sterling, a suspect in the shooting of a state trooper in Massachusetts, was killed during a shootout with U.S. marshals in the Bronx borough of New York early Friday, Dec. 4, 2020. (Massachusetts State Police via AP)

This poster, from the Massachusetts State Police Twitter page, posted Nov. 24, 2020, shows Andre K. Sterling. Sterling, a suspect in the shooting of a state trooper in Massachusetts, was killed during a shootout with U.S. marshals in the Bronx borough of New York early Friday, Dec. 4, 2020. (Massachusetts State Police via AP)

A second man who was in the apartment was arrested, the official said. He was believed to have been hospitalized following the shooting.

It was not immediately clear whether the fifth person was another agent. 

Sterling was wanted by the Massachusetts State Police for allegedly shooting a trooper in November, officials said.

He had been sought in the shooting of a 28-year-old trooper on Cape Cod during a late-night traffic stop on Nov. 20. The trooper was hospitalized after a round went through his right hand and appeared to have struck his ballistic vest.

CLICK HERE TO GET THE FOX NEWS APP 

Sterling had two more warrants in Massachusetts on charges including identity fraud and assault and battery on a police officer, and he was wanted on narcotics charges in Wyoming, according to police in Massachusetts.

The Associated Press contributed to this report.