A man armed with a machete who was barricaded with a child inside a southern California home was shot dead after charging at deputies Tuesday night.

The Riverside County Sheriff's Department told FOX 11 Los Angeles that deputies responded to a home in San Jacinto just before 1 p.m. after a woman reported her boyfriend was armed with the blade and behaving erratically. The woman was able to escape the home safely, but the suspect stopped her from taking her 12-year-old child.

When deputies tried to rescue the child, the suspect allegedly hit one of the deputies in the head with a wooden object before swinging the machete at another deputy. 

The suspect was then shot, officials said. He was taken to a hospital where he later died. 

CA POLICE OFFICER WILL NOT FACE CHARGES FOR ACCIDENTALLY KILLING BYSTANDER

SUV vehicle for Riverside Sheriff's Office

Riverside sheriff's vehicle.  (Riverside Sheriff's Department)

The child was safely removed from the home.

One deputy was treated at the scene for unspecified injuries, while another was taken to a hospital for treatment of non-life-threatening injuries. 

CLICK HERE TO DOWNLOAD THE FOX NEWS APP

The investigation remains ongoing.  

Anyone with information regarding this incident is encouraged to contact Riverside County District Attorney Investigator J.R. Ferrer or Riverside County Sheriff’s Investigator Nelson Gomez at 951-955-2777.