An assailant wielding a sword stabbed a 56-year-old man in San Francisco’s Tenderloin neighborhood early Wednesday in what police are investigating as a random attack.

The victim told officers he was standing in front of his apartment building on the 400 block of Eddy Street when the saber-swinging suspect approached him about 2:40 a.m. and stabbed him in the stomach without warning, said Officer Albie Esparza, a police spokesman.