The shooting was reported at about 7:30 a.m. on Connecticut Street just north of 25th Street.
The 36-year-old victim was approached by the suspect, who asked for her radio. When the woman refused, the man pulled out a gun and pointed it at her, according to police.
The woman's husband, who was with her, grabbed the handgun, which fired a round that struck the woman in her left ankle, police said.
The suspect ran away but was known to the victim, who provided information about him to police that led to his arrest shortly afterward.
The woman was taken to San Francisco General Hospital to be treated for her injury, which is not life-threatening, according to police.