The incident started around 5 p.m. when police got a call that a man was brandishing a handgun in the Potrero Hill Projects.
San Francisco police say the victim was shot multiple times, but he is in non-life threatening condition.
Police Chief Greg Suhr says the incident will be thoroughly investigated.