It is believed a disgruntled UPS employee opened fire on his co-workers, before turning the gun on himself.
Police have not determined a motive.
(AP Photo/Eric Risberg). UPS workers gather outside after a reported shooting at a UPS warehouse and customer service center in San Francisco on Wednesday, June 14, 2017. "I know my (UPS) driver; I know him personally".
The gunman was identified by authorities as San Francisco resident Jimmy Lam.
The investigation into the shooting at the UPS facility is ongoing.
The official said Lam is from San Francisco, but had no immediate details on his background.
"Cook said he heard another series of five shots before the area fell silent and he escaped from the building with others".
Mr Lefiti's cousin, Mack Toia, told KGO-TV he was waiting to pick up Mr Lefiti when he heard shots.
Isaiah Miggins, a UPS loader on the overnight shift, said it was hard to finish his shift.
"It could have been worse", he said, "lives were saved today".
A woman named Michelle, who did not want to provide her last name, was walking to work across the street from a UPS facility when she saw several UPS employees running down the street.
Another neighbor said it was sad of course for the people who got killed and that it was something they'd never expect. And the driver did.
The others are people who were already facing charges.
Lam told Vu that he would speak with management and then took off work for several months.
Lam killed three co-workers before dying from a self-inflicted gunshot wound. The gunman fatally shot himself when confronted by police, authorities said.
Spokesman Steve Gaut told The Associated Press that the gunman opened fire inside the facility before the drivers were sent out for their daily deliveries.
UPS driver Marvin Calderon told NBC Bay Area he witnessed the shooting and ran for his life.
Video footage from the scene showed a massive police presence near the facility, with workers being escorted outside and embracing one another on the sidewalk. A police "contact team" soon found him armed with an assault pistol, the assistant chief said. People said prayers and signed a poster honoring their three longtime colleagues. Two others were wounded.
Chaplin said police were interviewing hundreds of witnesses.
Police treated the facility as a crime scene and put it on lockdown.
Officers arrived to learn the suspect was still inside the building, Chaplin said. "I get to take my husband home and someone else doesn't".
The UPS spokesman Steve Gaut said that six UPS employees were drawn in a shooting incident but until police investigations company can not provide information related to the employees. Their conditions were not immediately known and none of the victims' names was released.
Police have completed the search for additional victims. The shooter and all the victims were employees, UPS said in a statement. She says the shooting happened on the main sorting floor and that the gunman is a current employee. UPS is providing trauma and grief counseling to employees at the San Francisco centre.
SFPD says there are six shooting victims.
Chaplin would not confirm that the shooter was an employee - only that he was dressed in the familiar brown uniform. They walked away calmly with emergency vehicles nearby. Police are asking people in the area to shelter in place.
The building is located in Potrero Hill, which is about 2.5 miles from downtown San Francisco.