LOS ANGELES (AP) — A man stabbed a doctor and two nurses inside a Southern California hospital emergency ward on Friday and remained inside a room for hours before police arrested him, authorities said.

The man walked into Encino Hospital Medical Center in the San Fernando Valley shortly before 4 p.m., Los Angeles police Officer Drake Madison said.

The man had parked his car in the middle of a street and went to the emergency room, where he asked for treatment for anxiety before stabbing the doctor and nurses, authorities said.

Fire officials said three victims were taken to a trauma center in critical condition. Police later said one was in critical condition and underwent surgery.

All three were later listed in stable condition at Dignity Health Northridge Hospital Medical Center.

The first floor of the Encino hospital and some nearby offices were evacuated, police said.

“We've moved patients out of the danger zone," LAPD Deputy Chief Alan Hamilton said at a news conference.

There was no evidence that the man knew the victims, Hamilton added.

The man remained inside a room in the hospital for about four hours as SWAT team members tried to unsuccessfully to negotiate with him before he was finally arrested, police said.

He was taken to another hospital for treatment of self-inflicted injuries to his arms, authorities said.

The man's name wasn't immediately released, but Hamilton said he had a lengthy criminal record, including two arrests last year for battery of a police officer and resisting arrest.

Benjamin Roman, an ultrasound technician, told KNBC-TV that before the stabbing, he saw the man, who had a dog with him and who might have been high on drugs because he looked anxious and was drenched in sweat.

After the hospital issued an “internal triage" code, Roman said he saw a doctor and a nurse who had been stabbed.

“The doctor looked (like) she was in pain," he said. “There was a lot of blood and it looked like ... he might have got her abdomen."

The attack comes only two days after a gunman killed four people and then himself at a hospital in Tulsa, Oklahoma. The assailant got inside a building on the Saint Francis Hospital campus with little trouble, just hours after buying an AR-style rifle, authorities said.

The man killed his surgeon and three other people at a medical office. He blamed the doctor for his continuing pain after a recent back operation.