A father charged with killing his 2-year-old son demonstrated on a doll how he slashed the boy’s throat during an interview with detectives, Cook County prosecutors said at the Little Village man’s bond hearing on Friday.

Rolando Ortiz, 37, tried to kill himself after he stabbed Mateo Garcia Aguayo to death Wednesday afternoon in their second-floor apartment in the 2700 block of South Avers, police said.

After the murder, Ortiz called his sister-in-law and told them, his son “was with God and that he killed his son,” authorities said.

Judge Mary Marubio ordered Ortiz held without bail, adding that Mateo’s death showed “heinous behavior indicative of wanton cruelty.”

Ortiz was home with his son after completing an overnight shift in a factory where he did maintenance work, Assistant State’s Attorney Jamie Santini said. Ortiz “grew frustrated” when he couldn’t fall asleep because the 2-year-old was running around the house and jumping on Ortiz as he lay in bed.

“The defendant pinned the child on the floor so that the child could not move,” Santini said. “As he held the child down, the defendant reached over and grabbed a large kitchen knife from a nearby table. The defendant then held his son down with one hand and used the knife in the other hand to saw across the child’s throat multiple times, killing the 2-year-old.”

Mateo’s spinal cord was severed, Santini said.

Ortiz put Mateo’s body in a garbage bag, wiped the blood off the kitchen floor with some clothes and put those clothes in the same garbage bag, Santini added.

“He intended to dispose of the bag in the garbage,” Santini said.

Ortiz — who appeared in court wearing a blue medical jumpsuit — was arrested in south suburban Kankakee after police tracked his cellphone, Santini said.

“These are the kinds of tragedies that keep police officers working without sleep,” Chicago Police Supt. Eddie Johnson said Thursday.

Mateo would have turned 3 years old in March, Santini said.

Ortiz and his wife work opposite shifts in the same factory, with Ortiz working the night shift and his wife on the day shift, Santini said. They have three children together, including Mateo. The other two children were at school while Ortiz was watching Mateo.

Ortiz, who was born in Mexico but has lived in Chicago for about 14 years, has worked at the factory for six years, his public defender said.

Ortiz called his wife after slashing the boy’s throat, but couldn’t get through to her, so he called his sister-in-law and “confesses to killing the baby over the phone,” Chicago Police Area Central Detectives Cmdr. Brendan Deenihan said Thursday.

The sister-in-law then called family members who lived one floor below Ortiz. They went upstairs and found the child in the garbage bag and called police, according to Deenihan.

Ortiz ran to his car and fled, Deenihan said. He was apprehended about four hours later in Kankakee. The FBI, Illinois State Police and Kankakee Police assisted in the arrest.

After he was brought back to Chicago on Wednesday, he confessed to the killing in police custody, Deenihan said.

Ortiz has no prior arrests, Deenihan said. Six other children live in the home, but none was there at the time Mateo was killed.