Home invaders pose as police, gunfight breaks out with family inside "It was a home invasion that went terribly wrong," said police.

A gunfight broke out at a home and a suspect was killed when men posing as sheriff’s deputies attempted a home invasion and got more than they bargained for from the family inside.

The frightening situation occurred in Tulare County, California, around 10 p.m. on Tuesday night when a family was sitting inside their home and heard a loud banging on their front door with several men yelling “sheriff’s office” in an attempt to get the occupants to let them in, according to ABC News’ Fresno station KFSN.

But when the family didn’t let the men at the door in, the suspects decided to force their way into the home.

"They can hear them yelling 'Sheriff's Office, Sheriff's Office,' says Tulare County Sheriff's Lt. Joe Torres. "The victims thought it was odd that it was late hours, so the suspects then forced their way into the living room area, they busted the front door."

It was at this point the occupants inside the home knew the suspects were not law enforcement since they weren’t wearing uniforms or badges and a gunfight broke out between the homeowner and the home invaders.

One of the suspects was struck in the upper body by the homeowner while his wife, child, and another man ran for safety.

The suspect who was shot died at the scene while the other suspects made a run for it after their attempted home invasion.

"Although we are in the early stages, it was a home invasion that went terribly wrong," Torres said. "There were four people in the residence, along with a 13-year-old that could have all been killed if it wasn't for the homeowner taking action."

Authorities say they are not ready to release the motive behind the break in and that the identity of the man who was killed will be revealed after the autopsy which will be completed on Thursday.