The girl was walking home with her father on Third Street near Palou Avenue at around 4:30 p.m. on Sept. 20 when the father heard gunshots, then saw his daughter had been shot in her left knee, according to police.
Police believe the girl, who was hospitalized but survived the shooting, was caught in the crossfire between two suspects firing at each other.
Through investigative leads, video surveillance and tips from community members in recent weeks, investigators were able to identify the 16-year-old, whose name is not being released, as one of the two shooters.
At about 4 p.m. Wednesday, officers spotted suspicious activity in the area of Kirkwood Avenue and Mendell Street, a known gang hangout, police said.
A suspect made eye contact with the officers and started running away, as did several other people in the area.
One of the fleeing suspects removed a gun from his waistband. He was detained and the discarded gun was recovered, police said. An officer recognized one of the other people who ran away as the teen who was wanted for the shooting and detained him.
The teen was subsequently booked into the Juvenile Justice Center on suspicion of assault and weapons charges, with an enhancement for injuring a victim 5 years old or younger, police said.
Supervisor Malia Cohen, whose district contains the Bayview, said in a statement, "I would like to thank the many members of the community who came forward to support the victim and her family and the San Francisco Police Department for their work on this incident."
Police spokesman Sgt. Mike Andraychak said investigators are still seeking the second suspect in the shooting but do not have any information about him.
Anyone with information about the shooting is encouraged to call the Police Department's anonymous tip line at (415) 575-4444 or send a tip by text message to TIP411.