The 36-year-old victim flagged down officers at about 1:55 a.m. near Fresno Street and Romolo Place and said he had been robbed, police spokesman Sgt. Mike Andraychak said.
The man had apparently been at a nearby bar and met three people outside the bar. When he went to urinate in the alley, one of the suspects punched him in the head and stole his tablet computer and the trio fled, Andraychak said.
When the victim flagged down the officers, they picked him up in their car and began searching the area for the suspects.
Shortly afterward, police found and detained three people near Broadway and Kearny Street who the victim identified as the thieves, according to Andraychak.
Barry Guen, 19, of Oakland, was identified as the attacker and was arrested on suspicion of robbery.
Arlene George, a 19-year-old woman from San Pablo, had the tablet computer concealed on her person and was arrested on suspicion of possession of stolen property, Andraychak said.
The third suspect, 18-year-old San Francisco resident Rashaun Jones, was arrested for a marijuana violation, Andraychak said.
The victim declined transport to a hospital for injuries he suffered in the attack, Andraychak said.