Officers responded to an electronic alert of shots fired in North Bellport shortly after 8 p.m. Monday, Suffolk County police said.
A short time later, a 19-year-old Bellport resident walked into Brookhaven Memorial Hospital Medical Center in East Patchogue with a gunshot wound to his right hand, police said.
Detectives interviewed the man, who was not arrested, police said. He was treated and released from the hospital, police said.
Officers recovered shell casings from the roadway at Patchogue Avenue and Michigan Avenue.
The shots were reported electronically by ShotSpotter, which relies on the sound of gunfire to locate its origin, police said.
Detectives ask anyone with information on the case to call the Fifth Squad at 631-854-8552 or CrimeStoppers at 800-220-8477.