SAN FRANCISCO — United Parcel Service trucks started rolling again Thursday at a warehouse in San Francisco where an employee a day earlier shot and killed three colleagues and wounded two others before he killed himself in front of police officers.

Investigators were trying to determine what prompted Jimmy Lam, 38, to open fire during a meeting with co-workers.

Lam, a UPS driver, had filed a grievance claiming that he was working excessive overtime and appeared to specifically go after the three drivers he killed before fatally shooting himself.

He filed the grievance in March complaining of too much overtime and requesting that the package delivery company relieve him of working extra hours going forward, Joseph Cilia, an official with a Teamsters Union local that represents UPS workers in San Francisco, told The Associated Press.

During a Wednesday morning meeting, Lam walked up to driver Benson Louie and shot him. As his co-workers frantically fled the room, he shot Wayne Chan in the back, and then walked up to him and "finished him." Mike Lefiti was fleeing from the building when Lam went out onto the street and shot him, Cilia said witnesses told him.

"It's senseless. I can't think of anything. Why him? Why them?" Cilia asked. "I can't put it together."

Officials late Wednesday confirmed San Francisco residents Louie, 50, and Chan, 56, and 46-year-old Lefiti, of Hercules, were killed in the shooting.

Two other UPS employees were wounded, but Cilia said both were released from the hospital.

Amid a barrage of gunfire, some workers sought refuge on the roof of the four-story facility, while others ran outside and pounded on the windows of a public bus, witnesses said.

"They were screaming, 'Go! Go! Go!'" said Jessica Franklin, 30, who was riding to work when the bus made a regular stop in front of the UPS facility. "As they got on the bus, they were all ducking."

Auto shop owner Robert Kim said he saw "a mob of UPS drivers" running down the street screaming "Shooter! Shooter!"

The shooting prompted a massive police response in one of the city's industrial neighborhoods, about 2 miles (3 kilometers) from downtown San Francisco, Assistant Police Chief Toney Chaplin told reporters.

UPS spokesman Steve Gaut said the shooter was a company employee. A San Francisco Police Department official identified Lam, 38, and said he's from San Francisco but had no immediate details on his background.

The official spoke on condition of anonymity because the investigation is ongoing.

Lefiti's cousin, Mack Toia, told KGO-TV (http://abc7ne.ws/2sch61d) he was at the UPS facility waiting to pick up Lefiti when shots rang out. He left his van and saw his cousin sprawled on concrete behind a gate, Toia said.

"The police officers were right on the scene just like that. I got to touch him, but I couldn't hug him," Toia said. "They just pushed me away because they were trying to resuscitate him."

Co-worker Isaiah Miggins said he saw Lefiti, known as "Big Mike," as he arrived for work just before 9 a.m., a few minutes before the shooting started. "He was a joyful man. Always happy," Miggins said.

On social media, heartbroken family members of Lefiti recalled him as a warm-spirited man devoted to his children and family. A photo on his Facebook page shows Lefiti in his brown UPS uniform holding a trophy. He also posted photos of his UPS truck and an award for 15 years of service to the company in 2015.

A 30-year-old tech worker who lives across the street from the warehouse said he heard up to eight gunshots.

"They were all in rapid succession," said Raymond Deng. "It was like tat, tat, tat, tat, tat, tat, tat."

Deng watched from his window in the Potrero Hill section of San Francisco as workers fled the building. He said another group of about 10 people gathered on the roof and held up their hands waving for help.

"I saw police officers go up from the ramp and then storm the buildings," he said. "It's crazy."

Officers found two victims outside and others inside and pulled the wounded to safety as they confronted the gunman, who was armed with an "assault pistol," Chaplin said.

"The suspect put the gun to his head and discharged the weapon," Chaplin said, adding that police did not fire any shots. Two guns were recovered at the scene, he said.

The shooting happened the same day a gunman opened fire on Republican lawmakers at a congressional baseball practice in Virginia, wounding U.S. Rep. Steve Scalise of Louisiana and several others.

AP writers Janie Har, Jocelyn Gecker and Linda Wang in San Francisco and Mike Balsamo in Los Angeles contributed to this story.