UPS workers evacuate their building at the scene of an active shooting at 16th Street and Utah Street in San Francisco on Wednesday, June 14, 2017. (Photo: Gabrielle Lurie/The Chronicle)

San Francisco police said that two other victims suffered gunshot wounds when Lam, a UPS employee began firing inside the facility. It was not immediately clear what prompted the shooting. Assistant Chief Toney Chaplin said during a press conference at the scene that the worker was armed with a pistol when police arrived. Lam turned the gun on himself as police approached, Chaplin said.

San Francisco police are investigating if Lam randomly targeted people. Sources tell KTVU that all of the victims are men.

Police recovered two firearms at the scene.

A UPS official told KTVU that four employees were involved in the incident within the facility but the company could not provide identification information about the employees who worked at the package delivery center.

SAN FRANCISCO (KTVU) -- UPS workers were shocked, grief stricken and left wondering how something so awful could happen on what seemed to be just another work day.

Four people, including the alleged gunman, were killed during a shooting Wednesday morning at a UPS facility in San Francisco's Potrero Hill neighborhood, authorities said.

Office of the Chief Medical Examineri dentified the gunman as Jimmy Lam, 38, of San Francisco. A union official says the gunman who shot and killed three people at a UPS warehouse in San Francisco had filed a grievance complaining that he was working excessive overtime.

The three victims who were killed were also identified and next of kin has been notified. Their names are Wayne Chan, 56, of San Francisco, Benson Louie, age 50, a resident of San Francisco, and Michael Lefiti, 46, of Hercules.

Joseph Cilia, an official with a local Teamsters Union, says Jimmy Lam's grievance filed in March requested that UPS relieve him of working overtime going forward.

Still, Cilia said Lam wasn't angry, and he could not understand why he would open fire on fellow drivers at a morning meeting. Cilia says witnesses told him Lam appeared to specifically go for the drivers who died, chasing at least one of them out of the building.

San Francisco police asked people to avoid the area of 17th and Vermont streets while officers investigated the shooting. A shelter-in-place for the area was lifted around 11:30 a.m., San Francisco police said.

A spokesman for Zuckerberg General Hospital says that multiple victims have been taken to the hospital, but cannot confirm their conditions.

UPS spokesman Steve Gaut said about 350 employees work at the facility at 320 San Bruno Ave. and they were evacuated by police at 12:30 p.m. while authorities investigate the shooting.

SFMTA spokesperson Paul Rose confirmed to KTVU that a group of uniformed UPS employees ran onto a Muni bus following the shooting to try and escape the area. He said the bus driver took the employees to 3rd and 20th where she pulled over and alerted authorities. The bus driver is said to have taken the rest of the day off, according to Rose.

311 employees have been reunited with their families as of 1:45 p.m.

Police wrote shortly after 10:30 a.m. that the incident has been contained and the building was secure, but investigators continued to look through the building for possible victims or witnesses.

A man who lives across the street from the UPS facility said he heard seven or eight shots fired quickly and saw workers running.

Raymond Deng, 30, a data scientist for a start-up company, said he looked out his apartment window Wednesday to see a group of UPS workers fleeing the building and shouting. He said another group of about 10 workers assembled on the roof and held their hands up as police began to arrive.

Deng says he "saw police officers go up from the ramp and then storm the buildings."

Witnesses told KTVU that they heard shots being fired and people screaming. Employees at the facility were being escorted out of the building around 9:45 a.m.

KTVU spoke over the phone with a woman who says she is an employee at the UPS facility. She says the shooting happened on the main sorting floor. She said the gunman was an employee.

A UPS driver said the gunman opened fire as drivers and managers were assembling for a morning meeting at the facility.

UPS driver Marvin Calderon said he had parked in the driveway and was about to go inside when he heard the sound of gunfire.

Calderon said he didn't know the gunman, but said one of the victims was his friend.

"Shocking. Life goes so quick. Thinking about your co-workers," he said.

Some relatives of UPS workers gathered outside the police perimeter on Potrero Avenue.

"I was at work, heard the news and left immediately," said Maria Olmeda, an employee's relative.

For a time she didn't know whether her 21-year-old son had been hurt or worse. But she later learned he was okay. She was both thankful and sad.

"It is scary for everyone," she said.

Another mother also waited to see her daughter.

"I feel for the parents of loved ones who aren't there. I know my daughter is okay. I just want to give her a hug," said Maria Hernandez.

Some employees reunited with family at a nearby meeting place arranged by the Red Cross.

U.S. Senator Dianne Feinstein issued a statement about the incident.

"I was heartbroken to learn that yet another senseless act of gun violence has marred our wonderful City. My heart goes out to the victims and their families, and to everyone affected by this despicable act."