Police Chief Anthony Batts said the gunfire erupted just before noon at Long Beach Memorial Medical Center.
Batts would not identify those involved but said all were male. He said the motive remained under investigation but noted the violence came amid a flurry of recent shootings in the country.
"This is a trend of active shooters that you have seen nationwide," Batts said at a news conference. "This is becoming a national trend, probably because of the tension that's going on in our society today."
Batts said officers responding to the shooting found one victim inside the hospital and then discovered a second victim outside, on the north side of the hospital outside the emergency room. Both were taken to the emergency room; one was dead and the other was critical, he said.
The suspect was found dead near the second victim, he said.
"It is with a really heavy heart that I say we lost two members of our employee family and a third is critically injured," said Diana Hendel, the hospital's chief executive officer. "Our first priority was to ensure that our patients were safe and well cared for and I can assure that our patients are well cared for and are completely safe."
Hendel said the victims' families were receiving counseling through the hospital's chaplain service.
City gas department worker Dave Chamberlain told KCAL-TV he heard shots and then saw a man waving a gun outside the hospital shoot himself.
"We heard five shots and we took cover as well, and then ... we could see a man with a gun pointed at himself," he said.
A woman, Charity Perez, told the TV station her husband, a hospital valet, knew the gunman and identified him as a worker at a pharmacy. The police chief would not confirm that, pending notification of the employees' families.
Laura Harris told KCAL she saw the shooter walk up, pull a gun and shoot a hospital employee in the leg.
"Then the young man fell and then he stood over him and shot a couple more times. Then he (the shooter) put the gun up under his chin," and shot himself, she said.
A youth, Justin Hawkins, said doctors got people into rooms during the shooting before police arrived.
"The doctors did the best job possible," he told KCAL. "They made us feel safe, they got us in the rooms as fast as possible, making sure nobody was in the hallways, making sure everyone was fine. And then the cops showed up really fast."
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.
Long Beach is about 25 miles south of downtown Los Angeles.
Slideshow archive | ABC13 wireless | Help solve crimes