LUBBOCK, Texas — Andrew Ybaben, 24, has accepted a plea agreement, according to court documents filed Tuesday August 20. In the documents, Ybaben admits to the production of child pornography.

The charge carries a sentence of at least 15 years, but no more than 30 years, according to court documents. Ybaben will also be required to register as a sex offender.

According to court documents, Ybaben’s wife discovered two videos on his phone that depicted Ybaben engaging in sexually explicit conduct with a seven-year-old girl. When Ybaben’s wife confronted him about the video, he fled the home, after which she reported him to law enforcement.

The victim appeared to be asleep in both videos according to court documents, and she said in an interview with detectives that she was unaware of what Ybaben did to her, but had previously told her sister she believed someone was coming in to her room and touching her.

Ybaben was arrested July 19 after a standoff with the Lubbock County Sheriff’s Office. According to court documents, Ybaben barricaded himself in a bathroom in his grandmother’s apartment and threatened suicide.

According to court documents, he had previously sent his wife text messages indicating he might commit suicide by cop because he would never have a “normal, formal life…ever again.”

Related Story: Court records reveal more about man arrested after standoff with LCSO