A man wanted for the shooting of a Massachusetts State Police trooper Nov. 20 is dead after a shootout in which two U.S. marshals were wounded in the Bronx Friday.

The gunfire erupted on Ely Avenue at around 5:30 a.m. as marshals were executing a warrant for the suspect, ABC reports.

The marshals had information that the suspect, Andre Sterling, 35, was inside and were let in by a resident.

Officials say that's when Sterling came out of a back room and started shooting. He was killed when marshals and officers returned fire.

Two U.S. marshals with the New York/New Jersey Regional Fugitive Task Force and an NYPD detective were rushed to Jacobi Hospital by other NYPD officers in a police cruiser.

One marshal was shot in the elbow and thigh. The other was shot in the leg. The detective twisted a knee.