A gunman and three hostages were found dead on Friday night after a daylong standoff with police at a Northern California veterans' home, law enforcement officials said.

The male suspect, armed with a rifle, exchanged fire with a sheriff's deputy and kept the three female hostages detained in a room at the Veterans Home of California-Yountville throughout the afternoon.

The suspect and three female hostages were found dead after officials made entry into the room, shortly before 6:00 p.m. local time, according to California Highway Patrol assistant chief Chris Childs.

“This is a tragic piece of news, one that we were really hoping we wouldn't have to come before the public to give,” Childs said.

The husband of one of the workers at the home told the Associated Press that the gunman took the hostages after he slipped into an employee going-away party in the building, detained certain people, and allowed others to leave.

“There was a going-away party for a couple of the staff who were leaving today. Today was their last day. They were having cake and toasting and apparently he just walked in with this rifle,” Larry Kamer, a former employee, said.

Local media outlets reported that the gunman was a veteran and a former member of The Pathway Home program, which says on its website that it helps veterans “cope with the effects of their deployment.”

The suspect was believed to be 36 years old and was discharged from the treatment program two weeks ago, according to The Napa Valley Register. The gunman was asked to leave the program after he broke certain rules, NBC Bay Area reported.

The initial reports of an active shooter at the Veterans Home of California-Yountville came in around 10:30 a.m., local time, a spokeswoman for the department told the San Francisco Chronicle.

“We are deeply saddened and affected by the tragic outcome of the hostage situation at the Veterans Home of California in Yountville and extend our deepest condolences to the loved ones involved,” Secretary of Veterans Affairs David Shulkin said on Twitter. “We ask for patience as we continue to monitor emerging details.”

Authorities set up a hotline at (707) 948-3331 for people to call for information on their loved ones at the veterans' home.

The facility is the largest veterans' home in the U.S., housing roughly 1,000 elderly or disabled veterans and their spouses, according to its website. The program treats Iraq and Afghanistan war veterans with post-traumatic stress disorder, and helps them reintegrate back to civilian life, according to KRON-4 News and The Washington Post.

Read more from Business Insider: