Officers responded to a report of shots fired in the 3500 block of Geary Avenue near Jordan Avenue at about 2:15 a.m., San Francisco police Lt. Troy Dangerfield said.
The victim, who had been shot twice in the torso, was taken to a hospital and is expected to survive, Dangerfield said.
Two suspects in a silver car were later detained and arrested for the shooting.
The incident remains under investigation.