LOS ANGELES — A gunman in a UPS uniform killed three people and wounded two others before turning his weapon on himself as police approached at a company facility in San Francisco early Wednesday, authorities said.

The suspect, identified late Wednesday as Jimmy Lam, 38, of San Francisco, was dead from a self-inflicted gunshot wound, San Francisco police said. Police believe there was only one shooter and said the incident did not appear to be related to terrorism.

San Francisco police Assistant Chief Toney Chaplin said at a press conference Wednesday that officers responded to a call of several people shot at the UPS facility at around 8:55 a.m. local time (11:55 a.m. ET).

Officers determined the shooter was still in the building and when they encountered the armed suspect he "put the gun to his head and discharged the weapon," Chaplin said.

He added that the suspect was "dressed in a UPS uniform," but that investigators had not yet determined or confirmed whether he was a current employee. Investigators were still working to determine a motive.

"The officers did what they were trained to do and that is when we have an active shooter we engage the active shooter to stop the shooting, and the officers did that," Chaplin said. "This person took their life because our officers confronted him."

No police officers fired, he said.

Chaplin said police were interviewing hundreds of witnesses. Some of the shot victims were found outside the facility and some were inside, he said.

UPS driver Marvin Calderon told NBC Bay Area he witnessed the shooting and ran for his life. Calderon told the station employees had just finished with a daily briefing when gunfire rang out.

"I just heard bam, bam, bam, six shots, probably seven — everybody ran out outside on the corner of San Bruno and 17th. And then I heard five more shots," Calderon said. He said the gunman was a fellow employee.

"I just started running out like crazy, like I've never run before," he said.

UPS workers hug at the scene where a gunman shot and killed multiple people including himself at a UPS facility on June 14, 2017 in San Francisco. Josh Edelson / AFP - Getty Images

Auto shop owner Robert Kim told NBC Bay Area that he saw a large group of workers running, shouting "shooter, shooter."

It had not been confirmed Wednesday afternoon whether the gunman was an employee or whether he was targeting specific people, Chaplin said. "We hope to find that out once these interviews are completed," he said.

The two injured people who were shot were being treated for gunshot wounds Wednesday afternoon. Five other people suffered other injures which were believed caused in the evacuation of the facility, Chaplin said.

UPS said in a statement that there was a "shooting incident involving six employees" within the company's facility in the neighborhood of Potrero Hill.

The company said it could not provide the identity of the people involved pending the police investigation.

"We understand that there are four deaths, although some individuals were transported to the hospital and we are unsure of their status at this time," UPS said in the statement.

"The company is saddened and deeply concerned about affected employees, family members and the community we share," UPS said. "Our thoughts and prayers are with all those touched by this incident."

People being evacuated hold their hands above their heads for police in the area of a shooting incident at a UPS facility in San Francisco, California on June 14. Stephen Lam / Reuters

UPS employs 350 people at the San Francisco facility, according to the company.

The Bureau of Alcohol, Tobacco, Firearms and Explosives said on Twitter that they were responding to the shooting incident and providing report to San Francisco police.

San Francisco Mayor Ed Lee called the shooting a "senseless act of violence" and said his thoughts were with the individuals and families affected.

"We all know the familiar faces of our local UPS drivers and delivery persons. Today’s tragedy will be felt in every community served by these committed employees," Lee said in a statement. "We are always saddened when someone loses a life to gun violence. Even one shooting and one victim is too many."

Andrew Blankstein reported from Los Angeles, Daniella Silva reported from New York.