The patient who opened fire on a caseworker and psychiatrist at a unit of Mercy Fitzgerald Hospital intended to kill the doctor and possibly others - and might have succeeded if the psychiatrist had not pulled his own gun, authorities said Friday.

Richard Plotts was carrying a loaded revolver and 39 bullets when he arrived for his appointment Thursday afternoon, Delaware County District Attorney Jack Whelan said. Plotts got off enough shots to kill caseworker Theresa Hunt and wound psychiatrist Lee Silverman before the doctor drew his own weapon and shot Plotts three times.

"If Dr. Silverman did not have the firearm and did not utilize the firearm, he'd be dead today," Whelan said. "And other people would be dead."

One day after the shooting sparked panic and a massive police response on the hospital campus in Darby Borough and Yeadon, a fuller picture began to emerge of the gunman and his victims.

Hunt, 53, lived alone on a close-knit block in Philadelphia and had told neighbors that her job - helping psychiatric patients find homes and treatment - at times made her fear for her own safety.

Silverman, 52, was apparently in the habit of bringing his .32-caliber handgun to his job, despite the hospital's no-firearms policy.

And Plotts, 49, an Upper Darby man listed in critical but guarded condition Friday at the Hospital of the University of Pennsylvania, has a long history of mental illness, violence, and crime, according to records. Police said they had been called to the hospital campus at least once before for an incident involving Plotts.

At a news conference in Media, Whelan said he expected to file charges against Plotts - including first-degree murder - within a day or so. He declined to comment on Plotts' mental state, except to say Plotts "knew what he was doing" when he opened fire.

Whelan said Plotts went to the hospital complex along Lansdowne Avenue with Hunt just after 2 p.m. Thursday. It was not clear if the visit was court-ordered, but his appointment at the Sister Marie Lenahan Wellness Center was routine; Plotts had been a sporadic patient of Silverman's for about 20 years, Whelan said.

As Hunt and Plotts sat together on a couch in the room, Plotts became agitated and started shouting. The two stood up, Whelan said, and Plotts drew a .32-caliber revolver.

Whelan would not say what prompted the argument, but said a hospital staff member heard the commotion and opened the door wide enough to see Plotts with a gun. The staff member called 911.

Plotts shot Hunt twice in the head, Whelan said, and Silverman dropped behind the desk chair, drawing his gun from his pocket. Silverman then shot Plotts twice in the torso and once in the leg.

Plotts kept shooting, the prosecutor said.

"We believe [Plotts] was going to reload that revolver and continue to kill," Whelan said.

Instead, he was stopped by two hospital staffers, Whelan said: Jeffrey Dekret, a doctor, and caseworker John D'Alonzo, who burst into the room, tackled Plotts, and wrestled the gun from him.

Whelan said he did not believe Silverman was expecting an argument with Plotts that day.

The doctor is recovering from graze wounds to his head and a hand. In a statement, the hospital said it looked forward to his "return to serving patients at our hospital."

Whelan said Plotts had at least once before expressed anger at not being allowed to bring a gun inside the hospital.

The prosecutor did not elaborate.

As a felon, Plotts was prohibited from owning a weapon; police say they believe he got it outside Delaware County.

Plotts' criminal record dated at least to 1990, when he was arrested in Philadelphia and sentenced to probation for carrying an unlicensed gun. The following year, he was again arrested with an illegal gun and got probation.

He later was sentenced to 80 months in federal prison for robbing a Delaware bank, and twice violated terms of his release, records show.

Michael Chitwood, the Upper Darby police superintendent, said Plotts had a history of suicide attempts, and was involuntarily committed in 2007 and 2013. Plotts was also banned from Upper Darby's homeless shelter for violence, Chitwood said.

"Here is the tragedy of what we see in our society," Chitwood said. "You've got mental illness combined with a propensity for violence and easy access to firearms."

Yeadon Police Chief Donald Molineux said one of his officers recalled responding to the wellness center for an incident involving Plotts, though he did not know the details.

Plotts was known as a troublemaker to hospital staff, said an employee who did not want to be identified because he was not authorized to speak to reporters.

The same employee said he saw Hunt at work nearly every day. "She was a very, very sweet woman," he said. "Always had a smile on her face."

Hunt grew up on a farm north of Philadelphia and lived alone in the Kensington section, on a block where neighbors said she often joined them for small talk in the evening.

"We feel like we've lost somebody in our family, not just a friend," said Marge Labrum, who lives doors down from Hunt's two-story brick house. "It's the saddest thing. I'll never get over this."

Hunt often spoke about her work, and had recently mentioned that a client was bothering her. Labrum said she did not know who the client was, but said it was clear Hunt felt her job sometimes put her in harm's way.

"She was so nice to every one of us," Labrum said, her voice shaking. "We would never dream something like this could happen."

610-313-8113 @AESteele