CHICAGO — The man charged with murder in a Chicago apartment building fire that killed three children and an adult was angered over a deal for sex the woman reneged on, Cook County prosecutors said Wednesday.

During a bond hearing, prosecutors said Reginald Hester, 51, gave a videotaped confession admitting that on Aug. 23, he started the early-morning fire on the rear porch and interior stairway of the multi-unit building on Chicago’s South Side.

The flames and heavy smoke trapped many residents in their apartments and kept firefighters from getting inside. Several people jumped from windows and others were rescued by firefighters using ladders.

Killed in the fire were Melanie Watson, 4 months; Saniya Staples, 7, and Madison Watson, 4.

The father of the infant jumped from their third-floor apartment with the baby in his arms, according to prosecutors. She died from injuries sustained in the fall. The father survived the jump, suffering a broken pelvis and foot. A next-door neighbor, Kirk Johnson, 56, was found dead inside his apartment.

A woman told investigators she agreed to perform a sex act on Hester, saying she did so because she believed he owed her money, according to prosecutors. She said she left him standing at the building’s rear door and refused to admit him when he banged on the door. It was a short time later that the woman noticed smoke from that area of the building.

The woman identified Hester as a possible suspect in the fire. He was initially questioned in the case, but was released pending further investigation, prosecutors said. He was arrested late Tuesday and charged.

Judge Peggy Chiampas ordered Hester held without bond on four counts of first-degree murder and two counts of aggravated arson.