Police spokesman Albie Esparza says officers responding to reports of shots fired Friday at the San Francisco Giftcenter & Jewelrymart encountered a man covered in blood.
The man took out a gun and fired at officers before surrendering.
Esparza says the officers did not return fire.
Officers then went inside and found two people dead in the lobby of the building in the trendy South of Market neighborhood, just blocks from police headquarters.
Esparza says it's unclear if the shooting was connected to a robbery.
Officers are interviewing witnesses who ducked for cover when shots rang out.