MADERA COUNTY, Calif. (KSEE/KGPE) – The Madera County Sheriff said a man barricaded himself in the home and set it on fire after he pointed what appeared to be a rifle at deputies.

Video of the scene Tuesday night showed the fire as it tore through the home in the 27000 block of Avenue 16, right outside Madera city limits.

It all started after deputies responded to a call around 9:45 p.m. for a 37-year-old man, who lived on the property but not in the house, they say was acting erratic and trying to take residents’ car keys.

“They confront this man, he’s still armed with a rifle, he ends up pointing the rifle at the deputy. He then retreats inside the house and locks the doors, and barricades himself inside this residence,” said Madera County Sheriff Tyson Pogue.

Sheriff Pogue said deputies tried peacefully to de-escalate the situation before the fire started minutes later.

“Ultimately, they see him start a fire within the residence, he remains inside the residence, he refuses to come outside and the residence burns down with him inside it. And they did locate the assault rifle and they determined that it was actually an airsoft gun that’s a really close replica of an actual projectile firing rifle,” said Pogue.

Neighbor Pedro Velacquez came home to find the fire only steps away from his house.

“When I come back by 10:30, I see a lot of cops over here. You look at my house and the house and (I) say what’s going on? He say you better go somewhere else because something happened inside the house. One of the people in the house (has) an M16.” says Velacquez.

Velacquez says his newly finished office was completely destroyed along with multiple other structures nearby. He says he’s upset the fire wasn’t put out before it got to this point, leaving so much carnage.

“You know when it comes to the life and safety of residents and the deputies and the firefighters, that’s first and foremost. Then obviously, property protection comes second to that,” said Sheriff Pogue.

Sheriff Pogue said the Madera County Sheriff’s Office is working to confirm the man’s identity and notify next of kin.