A California man is accused of torturing his ex-girlfriend, locking her in a dog crate for hours at a time over a period of five months before she was able to escape.

Frank Guerra, 22, pleaded not guilty on Monday to charges including kidnapping and battery, The Turlock Journal reported. He was denied bail and is barred from contacting the woman.

The alleged abuse occurred between Aug. 1, 2015 and Jan. 4, 2016. The woman was eventually able to get away, though she didn’t contact police until February.

Guerra allegedly locked the woman, who is not being named, inside a 30-inch by 48-inch dog crate while he went to work each day, according to The Modesto Bee. She was reportedly forced to go to the bathroom in the cage and she has accused Guerra of smearing dog feces on her several times.

“[Guerra] bit her on the back and she’ll have permanent scarring,” Deputy District Attorney Beth DeJong said in court. “He locked her in a dog crate. [Sometimes] he pushed her to the ground and kicked her until she’d go inside.”

DeJong said Guerra texted photos of himself holding a gun after she had escaped and claimed he would post nude pictures of the woman on social media. He also allegedly left a voice message on her machine, which DeJong read in court.

“I know what I [expletive] did to you,” she said, quoting the message. “Putting you in a cage, [expletive] biting you…Not [expletive] trusting you…”

A pretrial hearing is scheduled for Friday.

Turlock is approximately 100 miles east of San Francisco.