Officers responded around 1 a.m. to reports of shots fired in the area of Valencia Street and Duboce Avenue, San Francisco police Sgt. Danielle Newman said.
No victims or shell casings were found at the scene, but police got a call about 35 minutes later about a gunshot victim at San Francisco General Hospital, she said.
The victim, who was treated for gunshot wounds to the arm and leg, told officers that he saw a fight start and was shot by stray bullets. A passerby drove the man to the hospital.
Newman said the victim refused to provide further information and no suspects have been identified or located.
The sergeant said police are investigating whether the shooting was gang-related.