A family birthday party in California over the weekend turned tragic when an off-duty welfare fraud investigator killed a police officer, critically wounded his own father and then killed himself — a bloody spree reportedly stemming from a fight between the assailant and his girlfriend, according to officials.

The Kings County Sheriff's Office said the incident happened around 9 p.m. Saturday at a home in Hanford, located about 33 miles south of Fresno, after 32-year-old Ramiro Trevino Jr. got into a violent argument with his girlfriend.

Trevino Jr.'s friend, Lemoore Police Officer Jonathan Diaz, 31, and Trevino Jr.'s father, Ramiro Trevino Sr., 58, reportedly intervened in the fight and attempted to get the woman to safety out of the home.

"It appeared the two victims were really trying to stop what was occurring," Kings County Sheriff Dave Robinson said at a news conference.

2 CALIFORNIA MURDER SUSPECTS ESCAPE FROM JAIL PROMPTING FRANTIC SEARCH

But when Diaz and Trevino Sr. attempted to speak to Trevino Jr., the Kings County welfare fraud investigator allegedly opened fire, striking each man multiple times.

"They definitely put their lives on the line to try to defuse the situation," Robinson said.

Lemoore Police Officer Jonathan Diaz was killed by his friend after intervening in a fight at a family birthday party over the weekend, according to officials.

Lemoore Police Officer Jonathan Diaz was killed by his friend after intervening in a fight at a family birthday party over the weekend, according to officials. (Huron Police Department)

Neighbor Julio Arevalo told KFSN-TV he thought the gunshots were fireworks.

"I heard three shots, but I didn't know they were shots at the time," he said.

After shooting his friend and father, officials say Trevino Jr. then fatally shot himself.

"I stepped outside, I looked and that's when I saw a body on the floor, and I was like, 'What just happened?'" Arevalo told KFSN-TV.

AIRBNB CEO SAYS COMPANY WILL BAN 'PARTY HOUSES' AFTER DEADLY HALLOWEEN SHOOTING IN CALIFORNIA

Diaz died at the scene, while the elder Trevino had to be rushed from his own birthday party to an area hospital, where he was listed in critical condition, FOX26 reported.

Lemoore Police Officer Jonathan Diaz tried to break up a fight between his friend and friend's girlfriend at a birthday party over the weekend and was fatally shot, according to officials.

Lemoore Police Officer Jonathan Diaz tried to break up a fight between his friend and friend's girlfriend at a birthday party over the weekend and was fatally shot, according to officials. (Huron Police Department)

Diaz, who leaves behind two children, was honored as Lemoore's public safety award recipient of the year, according to KFSN.

CLICK HERE FOR THE FOX NEWS APP

He was previously with the Huron Police Department, which posted a tribute to the fallen officer.

"Huron Police Department is saddened by the death of our former Huron Police Officer Jonathan Diaz, and City of Lemoore Police Officer, at the time of his death. We extend our sincere condolences to the family of Officer Jonathan Diaz, Lemoore Police Department, and those who knew and worked alongside Jonathan," the department said on Facebook.

[Editor's note: This story discusses suicide. If you or someone you know is having thoughts of suicide, please contact the National Suicide Prevention Lifeline at 1-800-273-TALK (8255).]

The Associated Press contributed to this report.