ATLANTIC CITY — Prosecutors have charged a Philadelphia resident with killing a man at a motel on Friday night, saying that he went on to shoot a second victim elsewhere in the city.

A SWAT team arrested Avery Bracey, 36, Friday night after getting a gunshot-detecting Shotspotter call from the area of North Florida Avenue.

That gunfire came after police had been called about 8:44 p.m. to the Sunset Inn on Route 30 on a report of a shooting. Police found a wounded Ky’Lee Haynes, 21, who was later pronounced dead at AtlantiCare Medical Center City Campus Trauma Center.

Police obtained a description of the gunman at the Sunset Inn. Prosecutors said the description matched Bracey, who police encountered on North Florida.

The second victim took himself to the emergency room, where he was treated for a leg wound.

Bracey has been charged with robbery, felony murder, murder, aggravated assault, and four counts of weapons offenses.