The shooting happened shortly after 6 p.m. near Market and Seventh streets, just a few blocks from the city's gay pride celebration at the Civic Center.
Investigators said they believe the gunfire was gang-related and was not connected to the festivities.
Two people were hospitalized with serious injuries while three others were treated for minor injuries. Two people were shot in the leg and one was shot in the buttocks, according to KGO-TV in San Francisco.
The suspect was described as a black male in his 20s, about 6 feet tall with dreadlocks. It was not clear as to what direction he fled.