A District police officer and a federal law enforcement agent on Tuesday fatally shot a Maryland man who was being sought in a domestic-related killing and had emerged from a residence near Union Station firing a gun, according to authorities.

D.C. police identified the man who was killed as Daquan Hendrix, 19, of Hyattsville and said he was wanted on a murder warrant in connection with the Feb. 27 slaying of Tykia Dickerson. Authorities said the 19-year-old woman from Southeast was shot to death on a sidewalk in the 3600 block of Jay Street NE near Kenilworth Gardens.

Police have said her shooting was the result of a domestic dispute but have not described the relationship.

Tuesday morning’s exchange of gunfire startled construction workers who are building a nine-story, 133-unit apartment building at First and K streets Northwest. It drew heavily armed tactical officers carrying assault weapons to the neighborhood roughly between the station and the NoMa area.

“It was like a war,” said Tim Reese, a crane-tower operator for Hamel Builders who heard the shots from a parking lot a few blocks away. “It was just like in the show ‘COPS.’ ”

Police would not say what led them to the apartment near the Sursum Corda apartment complex. The D.C. officers were part of a federal warrant squad, the Capital Area Regional Fugitive Task Force, run by the U.S. Marshal’s Service.

D.C. Police Chief Cathy L. Lanier said the suspect came out of a residence about 6:30 a.m. armed with a gun and fired at officers as they prepared to enter the residence with a warrant. She said a D.C. officer and a U.S. marshal returned fire, hitting him several times. He died shortly after arriving at a hospital.

In the chaotic aftermath, police thought that another person was hiding in the apartment, and additional members of the tactical squad arrived in riot gear. Police quickly determined that all other occupants of the residence had gotten out. For a time, several streets around the bustling Union Station area were closed as a helicopter hovered.

Reese and one of his co-workers, Pete DeBose, said they arrived at the construction site to find their parking lot filled with dark-colored, unmarked sport-utility vehicles and police officers.

About 6:30 a.m., they said, the officers took off into the housing complex adjacent to the new apartment building. A few minutes later, the two men heard gunshots.

DeBose said he heard six to eight shots; Reese said he heard six shots, then a pause followed by avolley of eight to 10 shots.

Michael Sprague, a concrete supervisor, said he was in his car parked on the east side of the building.

He said he saw officers rushing toward an apartment and thought, “I have to get out of here.”

He rushed into the partially constructed building and hid near an elevator shaft as the gunfire erupted.

Get updates on your area delivered via e-mail