The 41-year-old victim was shot in the foot around 7 p.m. Monday while waiting at a San Francisco Municipal Railway bus shelter at 16th and Mission streets, according to police.
The victim ran away and flagged down a passing police car about a block away. He was taken to San Francisco General Hospital to be treated for his injuries, which are not considered life-threatening.
Another patrol officer in the area heard the gunfire and chased a man he saw running away from the scene.
The officer lost sight of the man, but a short time later, another officer detained a man who matched the suspect's description, police said.
That man, an 18-year-old whose name had not been released as of this morning, was arrested. Police searched the route where the suspect was seen running and also found a handgun under a parked car.
Anyone who may have witnessed the shooting or has information about the case is encouraged to call the Police Department's anonymous tip line at (415) 575-4444 or send a tip by text message to TIP411.