Officer Jonathan Diaz, 31, died after Ramiro Trevino Jr. shot him as well as his father Ramiro Trevino Sr. at a home in East Hanford, California, on Saturday night, authorities said.

Kings County Sheriff’s Office said Trevino Jr. took his own life after shooting both men multiple times in his residence. Trevino Sr., 58, was in critical condition in hospital, Kings County Sheriff David Robinson said during a news conference on Sunday.

The sheriff’s office said 32-year-old Trevino Jr., a Kings County welfare fraud investigator, opened fire at his father’s birthday party at around 9 p.m.

He shot his father and his long-time friend Diaz, a Lemoore Police Department officer, after the pair had stepped in to de-escalate the fight Trevino Jr. was having with his girlfriend.

After the woman was taken out of the home, Diaz and Trevino Sr. came back inside and encountered Trevino Jr., who had armed himself with multiple guns.

Robinson said the two men “put their lives on the line” to defuse the situation, but Trevino Jr. shot them both, killing Diaz and leaving his father with serious injuries before turning a gun on himself.

“As a community, it’s very devastating to see something like this go on, especially involving two local police officers,” he said.

“Jonathan Diaz and Trevino Sr. were trying to do the right thing. By the witness accounts, they were trying to intervene in a situation that involved domestic violence.”

He added: “Unfortunately, it just escalated to the point where shots were fired and people died which is tragic.”

Three firearms were recovered from the scene—an AR-15 style semi-automatic rifle and two handguns, Robinson said. He said two of the weapons were registered to Trevino Jr. and the third was his department-issued duty weapon.

Robinson said investigators were not yet sure which weapons were fired during the shooting. He added that Trevino Jr. was drinking, but can’t determine how intoxicated he was or if anything else was in his system until toxicology reports are carried out.

Diaz’s brother Juan Diaz said his family treated Trevino Jr. as a member of the family.

“I think he was just trying to control the situation, knowing him,” he told ABC30. “Trying to calm his friend down, trying to make him realize what he was doing, and it just didn’t happen that way.”

Diaz left behind three children—two sons and a 10-month-old daughter, according to ABC30. His girlfriend Victoria Gonzalez told the station: “He always wanted to do better, not only for himself but for the community. He said he wanted to help any way he could to get gangs off the streets, especially for his family.”

Lemoore Police Department’s interim chief of police Mike Kendall said Diaz’s death would be treated as one that occurred in the line of duty.

“It’s my belief and my understanding of the actual homicide that Officer Diaz was acting in accordance with his duty as a police officer,” he said during a news conference on Monday. “I believe he saved a life. From a department standpoint, I’ll treat it as an in line of duty death.”

Kendall added: “It’s not surprising to me that he went above and beyond. Those in law enforcement have a true understanding that just because they are not in uniform, they still have a responsibility to take action.”

Kendall said Diaz graduated from the police academy in 2013 and began his law enforcement career as a reserve officer in Huron before joining the Lemoore Police Department in 2016. He was recognized as the department’s Officer of the Year in 2017, Kendall said.

Diaz was currently assigned to the Major Crimes Task Force, Kendall said. “He worked with members from every agency in Kings County, so it not only affects our Lemoore PD family, but it’s going to affect every agency in the county,” he said.

Diaz also set up a Youth Adult Awareness Program to mentor at-risk youths, Kendall said.

“You won’t find anybody here that did not like him. He got along with everybody,” he added. “He was just happy. He was happy to work here and he was happy in life.”

Diaz’s family are “are extremely proud of his career path and are humbled by the outpouring of condolences by the community,” Kendall added.