BAKERSFIELD, Calif. — A Bakersfield man attacked a woman with a sledge hammer and wooden chair during a home invasion earlier this month, according to documents released by KCSO on Friday.

KCSO say deputies were dispatched to a home near the corner of College Avenue and Montello Street the morning of June 5 for an active burglary, robbery, assault with a deadly weapon and child endangerment investigation. When officials arrived they discovered that 33-year-old Andrew Oldham had reportedly forced himself into the home's back door before attacking the victim with a sledge hammer and wooden chair. According to officials, several children were in the home at the time of the attack.

Documents say, the victim shot Oldham once in his lower body with a gun she grabbed from a safe. It was also noted that Oldham allegedly took the victim's gun and cellphone while she was on the phone with 911.

The victim sustained a small scratch on her left arm and declined medical aid. After Oldham was treated for his gunshot wound he was medically cleared for booking and taken into custody at the Central Receiving Facility.

When asked why he had attacked the victim, Oldham told police that this "person" had did something bad and he just had to know, according to documents.

In a police report previously obtained by 23ABC, it was revealed that Oldham is the cousin of the victim's husband and that Oldham is allegedly in love with her. Prior to the June 5 incident, the victim filed a restraining order against Oldham after he allegedly harassed her in front of her five children, niece and family friends.

When asked why she had never served Oldham the restraining order, she allegedly told officials that she didn't want to cause problems with her husband's family who told her that Oldham is "crazy" and needed medication.

Oldham has pleaded not guilty to charges of first degree burglary, assault with a deadly weapon, willful cruelty to child, false imprisonment with violence, and carrying a concealed weapon. He is due back in court on July 9.