An Illinois couple charged with killing their 5-year-old son did so because he lied about soiling his underwear, newly released court records show.

Search warrants previously sealed in McHenry County reveal that Andrew Freund Sr., 60, admitted to a detective that he and JoAnn Cunningham, 36, on April 14 forced Andrew “AJ” Freund to stay in a cold shower for 20 minutes before being sent to bed “cold, wet and naked,” the Northwest Herald reports.

“Drew explained that he wanted JoAnn to stop with the hard physical beatings and do some less violent form of punishment,” McHenry County Sheriff’s Detective Edwin Maldonado wrote in an affidavit. “Drew said cold showers was decided.”

Freund said Cunningham later found the couple’s son unresponsive in bed. After using his cellphone to search for instructions on “child CPR” hours later, Freund told police he put the boy’s body in a large plastic container in the basement of the family’s Crystal Lake home on April 15.

Two days later, Freund said, he put AJ’s body in garbage bags before moving it to the trunk of his car and ultimately burying it near electric utility towers near Woodstock, about seven miles away from the family’s home, Maldonado wrote.

Freund later led police to the boy’s body, which was wrapped in plastic and covered with straw, in a shallow grave on April 24, six days after the couple reported him missing and some nine days after he died, according to the affidavit. An autopsy found that AJ died of head trauma from multiple blunt-force injuries.

The document also detailed a two-minute video recorded in March that showed AJ covered in bruises and bandages while lying naked on a bare mattress, Maldonado wrote.

“In the video a female with a voice consistent with JoAnn’s is holding the phone and videotaping,” according to the detective. “She is berating AJ for urinating his bed.”

The boy had apparently not received adequate medical care, Maldonado wrote.

Freund later told investigators when confronted with the video on April 24 that he believed his son died on April 15. He told police that Cunningham was responsible for AJ’s injuries seen on the footage, according to the affidavit.

Child welfare caseworkers had sporadic contact with the boy since he was born with opiates in his system, which led him to be placed in foster care for more than a year, the Northwest Herald reports.

The family’s home, meanwhile, exhibited “hoarder-like conditions,” Maldonado wrote, including a basement filled with garbage bags.

Freund and Cunningham, who agreed earlier this week to give up custody of their 4-year-old son, remain held on $5 million bond each. They’re due back in court for a preliminary hearing on May 10.