A former Army soldier had been kicked out of a veterans facility where he opened fire Friday, killing three workers.

As the community mourned the victims, authorities on Saturday were trying to sort out the motive of a former Army soldier once deployed to Afghanistan who killed three people Friday at a veterans facility in Napa County where he was once a resident.

The Napa County Sheriff-Coroner’s Office identified the shooter as 36-year-old Albert Wong of Sacramento, who formerly was housed at the Pathway Home, a residential unit within the Yountville Veterans Home. He was found dead next to the bodies of three employees Friday afternoon, all with gunshot wounds.

Authorities identified the victims as the home’s executive director, Christine Loeber, 48; therapist Jen Golick, 42; and Jennifer Gonzales, 29, a psychologist with the San Francisco Department of Veterans Affairs Healthcare System.

At a news conference Saturday morning, officials said the victims brought a “unique sense of purpose and humanity to their jobs.”

Yountville Mayor John Dunbar said the Pathway Home program “has been unique from the very beginning,” partly because of the way it allowed veterans to interact with the community. The program included activities such as fishing or bowling trips.

In some cases, those in the program needed to be reintroduced into daily life, Dunbar said — that included being in crowded rooms or places with loud noises.

Some local businesses would offer the veterans anything they needed, he said, to “come and relax.”

“Sometimes that’s part of the programming, to just be human,” Dunbar said.

He said Loeber was tireless in her efforts on behalf of veterans: “She would sleep in her office more often than not because she had to be there to fill a shift. That’s the kind of personal dedication she showed all of us.”

The mayor described Wong as “one of our heroes who clearly had demons.”

Authorities said they don’t yet know whether Wong targeted the victims specifically or chose them at random.

President Trump on Saturday said on Twitter that he mourned “the loss of three incredible women who cared for our Veterans.”

Golick’s father-in-law, Bob Golick, told the Associated Press that she recently had expelled Wong from the program.

California Sen. Bill Dodd told KGO-TV that Wong had suffered from post-traumatic stress disorder from his service in the Middle East.

After an hours-long standoff, law enforcement officers entered the room at the veterans home where the gunman had been holding the hostages shortly before 6 p.m. That is where they found the four bodies.

Cissy Sherr, who with her husband became Wong’s legal guardian after his father died when he was a child, told the Santa Rosa Press-Democrat that she was devastated by the violence.

“Like many of our young men [in the military], he did see some rough times,” Sherr told the paper. “He’s always been soft-spoken, honest and patriotic and loyal. It’s heartbreaking.”

The first Napa County sheriff’s deputy to arrive at the scene exchanged gunfire with the gunman, who allowed some of the employees to leave before holing up in a room with the three hostages. Childs said authorities credited the responding deputy for saving lives “by eliminating the ability of the suspect to go out and find other victims.”

The deputy was not injured.

Childs said authorities tried throughout the day to reach the gunman on his cellphone to no avail. Three hostage negotiators were at the scene, but the standoff dragged on throughout the day with no contact with the gunman or the hostages.

The Los Angeles Times contributed to this report.