The shooting occurred shortly after 1 p.m. near Ellis and Leavenworth streets. The victims were found near the Comida Yucateca Dona Martha eatery at 499 Ellis St.
Police spokesman Sgt. Daryl Fong said three people were injured, but a lieutenant at the scene said he was only aware of two shooting victims.
The victims were shot in the lower parts of their bodies and were taken to San Francisco General Hospital, Fong said. Their injuries are not considered life-threatening.
Police Lt. Joe Cordes said it appears the shooter may have known the victims.
A witness, Darnell William, said he was a block away at Eddy and Leavenworth streets and saw a white or gray van speed up Leavenworth. He said he heard gunshots then saw the van speeding away.
William said the person or people in the van "seemed like they were on a mission."
Shortly before 2 p.m., fire crews were washing a pool of blood off of the sidewalk outside the restaurant. A restaurant employee said police had confiscated footage from a surveillance camera outside.
The 400 block of Ellis Street was briefly shut down after the shooting but has since reopened.
Anyone with 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.