Andrew “A.J.” Freund, a 5-year-old Illinois boy found buried in a shallow grave last month, was killed by his mother and father after they became enraged that he’d soiled his pants and failed to ’fess up about it, police allege in newly unsealed search warrants.

The McHenry County Coroner’s office announced last week that the boy had died as a result of “craniocerebral trauma” caused by “multiple blunt force injuries,” with police alleging that his parents, JoAnn Cunningham and Andrew Freund Sr., forced him to sit in a freezing cold shower while they beat him. Both were charged with first-degree murder in connection with his death, among other charges, but details on his final moments and what prompted the alleged fatal beating were scarce.

A search warrant affidavit written by McHenry County Sheriff’s Det. Edwin Maldonado now reveals that investigators began digging deeper into the parents almost immediately after they reported him missing on April 18, claiming the last time they’d seen him was when he went to bed the previous night.

Investigators found a two-minute video on JoAnn Cunningham’s phone showing A.J. “laying on a bare mattress in a crib” in his room, with a woman who sounded like his mother “berating [him] for urinating on his bed” while he was covered in bandages and heavy bruising all over his chest and head, according to the affidavit.

Andrew Freund Sr., his father, is said to have finally confessed to police investigators and a FBI agent that A.J. was not missing but dead after being shown that video. He allegedly told police the injuries seen in the footage were caused by Joann, who he said used “hard physical beatings” to punish her son when she believed he was being defiant.

He allegedly said A.J. died after being forced into a cold shower—a punishment he’d deemed to be less brutal than the beatings—for 20 minutes. The boy was punished because he “lied about soiled underwear,” he said, according to the court documents.

A.J. was put to bed “cold, wet, and naked,” according to the documents, and was later found unresponsive in bed. His father allegedly told investigators he stored A.J.’s body in a plastic tote in the basement of the family home for nearly two days before transporting the body to a wooded area in Woodstock and burying it.

A.J.’s 4-year-old brother, identified in local news reports as Parker but as P.F. in the police affidavit, told investigators his parents told him his brother “fell down the stairs and had a lot of owies.” He said his parents told him not to talk about A.J.

Both JoAnn Cunningham, who is seven months pregnant with another child, and Andrew Freund Sr. are being held at McHenry County jail with bond set at $5 million each. Their next court hearing is set for May 10. Authorities have also moved to strip them of their parental rights for their younger son, Parker, with the next court hearing on that matter set for May 30.