Patrol officers heard shots fired near Third Street and La Salle Avenue at about 1:30 a.m., San Francisco police Lt. Troy Dangerfield said.
Two men in their early 30s had been playing dice on the sidewalk, Dangerfield said.
One of the men apparently became angry during the game, retrieved a gun from his car and shot his opponent in the neck.
The victim was taken to a hospital and is expected to survive, Dangerfield said.
The suspect was arrested and taken into custody after a brief pursuit on foot. The suspect's alleged weapon was also taken into custody.
The shooting remains under investigation.