MEDIA, Pa. -- A patient had dozens of bullets on hand when he allegedly killed his caseworker and intended to kill more people at a U.S. hospital complex, authorities said Friday.

Delaware County District Attorney Jack Whelan said 49-year-old Richard Plotts had a problem with the hospital's ban on guns, although it wasn't clear if that was the direct motive for Thursday's shooting.

Psychiatrist Lee Silverman told police he fired back at Plotts with his own gun, wounding him, after Plotts opened fire in his office.

Silverman routinely carried a gun and had no specific fear of the suspect, Whelan said. He was grazed in the temple during the gunfight.

"There were some issues between the doctor and the patient, but whether or not he actually feared him is unclear," Whelan said.

Authorities said Plotts, 49, was sedated but in stable condition after surgery from his gunshot wounds. He was expected to be arraigned on murder charges Friday at his hospital bedside.

Police said Plotts had 39 bullets on him after the shooting.

The slain caseworker, 53-year-old Theresa Hunt, had accompanied Plotts to the psychiatric crisis centre, authorities said.

Police were aware of at least three mental health commitments involving Plotts -- once after he cut his wrists and once when he threatened suicide -- but said such stays can last just one to three days.

Plotts also had at least four gun arrests, along with assault and drug charges, according to police and court records.

Hospital policy bars anyone except on-duty law enforcement officers from carrying weapons on campus, a Mercy Health System spokeswoman said. She otherwise declined to discuss the reports that Silverman was armed at work.