BAKERSFIELD, Calif. (KGET) — A man accused of running into a house and sexually assaulting an elderly woman told detectives he believed his brother’s wife and children were being held hostage inside.

“I guess I was at the wrong house,” Sergio Gonzalez-Herrera said according to newly-released court documents.

Gonzalez-Herrera, 30, also said he’d last used drugs two days earlier when he snorted methamphetamine, the documents say. He told investigators he blacked out and doesn’t remember trying to have sex with anyone; he later claimed the woman tried having sex with him.

Gonzalez-Herrera faces charges including burglary and commission of a burglary with the intent to commit rape and is due in court for a preliminary hearing Tuesday.

Early Nov. 24, police were called to a report of an intruder armed with a knife who had barricaded himself inside the bedroom of an elderly woman on Hughes Lane nearly Valley Plaza mall.

Officers heard a scream for help and kicked in the bedroom door, the documents say.

They found a shirtless man on the bed and a woman on the floor. The man, later identified as Gonzalez, resisted arrest and officers used force to take him into custody, the documents say.

The woman told investigators she was sleeping when Gonzalez entered her bedroom. She said he removed his clothing, groped her and tried several times to rape her, according to the documents. She said she begged him to stop.

Another resident said he heard noise coming from the backyard at about 4:20 a.m. and found Gonzalez “tampering with his house,” the documents say. He said he went outside and told him to leave and Gonzalez managed to run inside and lock him out.

Looking through a window, the man saw Gonzalez grab a knife and begin walking through the house, according to the documents, and he called police.