Updated

Investigators were trying to figure out Friday why a hospital pharmacy worker known for being quick with a joke and a smile brought a gun to work and killed two of his managers before killing himself.

Police said Mario Ramirez, 50, showed up at the Long Beach Memorial Medical Center on Thursday and shot Hugo Bustamante and Kelly Hales before turning the gun on himself and pulling the trigger.

Witnesses described a chaotic scene as gunshots rang out just before noon, with panicked people running from the building and doctors ushering scared patients into rooms.

"When I got off the elevator, I heard screams," hospital employee Edward Collins said. An upset friend told him she had just seen someone she knew shoot someone. Collins then saw the shooter holding what appeared to be a black handgun.

"He was standing over the guy he shot," he said.

Collins said the gunman eventually pointed the gun at his own head and pulled the trigger.

Laura Harris, 64, told the Los Angeles Times she saw the second shooting as she drove by the emergency entrance.

She said the gunman shot Hales in the leg and, after he fell to the ground, "stood over him and shot him again." She said Ramirez then put the gun to his own head but appeared to be wavering, pacing and appearing frustrated.

"I don't know if he tried to shoot or if he was making up his mind," Harris said.

"Then he put it to his head" and pulled the trigger, she said.

Carmen Ortiz, 47, a hospital housekeeper, said she was outside for her break when she heard a gunshot and saw people running away from the building. She said her manager rushed out and told her to get inside.

"Then there was another shot, but I was inside," Ortiz said. "I was very frightened."

There was no immediate indication of why Ramirez, a technician at the outpatient pharmacy, killed Bustamante and Hales. Hospital spokeswoman Stacie Crompton-Hime said the 46-year-old Bustamante, of Cypress, was the pharmacy's manager and the 56-year-old Hales, of Redondo Beach, was its executive director,

When asked if the shooting may have stemmed from a dispute or possible layoffs at the hospital, Crompton-Hime said there were layoffs last month but no other reductions were planned.

Police Chief Anthony Batts said the motive remained under investigation, but noted it came amid a flurry of recent shootings in the U.S.

"This is a trend of active shooters that you have seen nationwide," Batts said. "This is becoming a national trend, probably because of the tension that's going on in our society today."

Ramirez's wife, Lydia, broke the news to their two sons Thursday night at the family's Alhambra home, said her sister, Eva Reyes. She declined further comment.

Ramirez's oldest son, Aaron, 14, sat on the front steps in the dark and hid his tears in the hood of a green sweat shirt on Thursday night.

He asked a TV cameraman what happened to his dad. The teen said his mother told him that his father had died, but he didn't know the details.

The boy said he came outside because he couldn't stand to see his mother and younger brother crying.

Neighbor Gina Marquez, 41, described Ramirez as a family man who was quiet and polite. He would often go jogging with his wife, she said.

"You never heard a peep from that house. It's unreal," Marquez said. "I can't imagine what state of mind he would have been in to do something like that."

Melo Dotski, a radiology department clerk, said she knew Ramirez by his first name for about two years. She said she used to help him with transactions when she worked as a teller at a bank at the medical center.

"He made all kinds of jokes, he was a funny man," Dotski said. "He was smiling, laughing, making sure everybody was doing OK."

Batts said officers responding to the shooting found one victim inside the hospital and outside the hospital near an emergency room entrance. Ramirez's body was found outside nearby.

A message left at Bustamante's home was not returned Thursday night. Hales' daughter, reached at the family's home, declined to comment.

The approximately 460-bed hospital is one of six health care facilities in Southern California operated by the not-for-profit MemorialCare system, run by Memorial Health Services.