An Iowa father and his girlfriend will spend up to three decades in prison for locking the man’s son in a dungeon-like room under their stairs.

Alex Shadlow and Traci Tyler each received three 10-year sentences Friday. The judge ordered the terms to be served consecutively.

Last month, Shadlow pleaded guilty to kidnapping and two counts of child endangerment causing serious injury. Tyler pleaded guilty to three counts of child endangerment causing serious injury.

The couple admitted to locking Shadlow’s 8-year-old son in a makeshift room for at least 30 days, WHOHD reported.

The dark, 6-by-6-foot room had cement floors, no blankets or furniture and just a tin can for a toilet. The boy spent up to nine hours a day in the room.

The Department of Human Services was alerted when teachers reported the boy had patches of hair falling out and was always hungry.

As punishment, the boy was forced to sweep and mop at the bar and grill Tyler worked at wearing a backpack full of rocks, according to criminal documents.

The boy told teachers he was locked under the stairs and only allowed out to attend school.