The shooting happened just before 1 a.m. at the corner of Mason and Market streets, in the 900 block of Market Street.
The men were trying to intervene in a verbal altercation between a man and woman who they did not reportedly know when the man pulled out a firearm and shot them, the Police Department said in a statement.
All four were hospitalized with injuries they were expected to survive as of Saturday morning.
INTERACTIVE: Take a look at the ABC7 Neighborhood Safety Tracker
The shooter fled the scene and was not immediately located.
The neighborhood's representative on the Board of Supervisors, Bilal Mahmood, said Saturday on X that suspects had been identified, but no arrests were made as of late Saturday morning, according to the Police Department.
Anyone with information about the shooting was asked to contact the San Francisco Police Department at (415) 575-4444. Tips can be texted to TIP411 by typing SFPD at the beginning of the message.