Authorities are investigating after a man was accidentally trapped inside Cook County Jail for more than 30 hours while attempting to visit his son over the weekend.

The man was visiting his son, who is awaiting trial on a drug case, early Saturday evening and was taken to a part of the Chicago jail he'd never been after his son was moved.

After being directed to "go down the hallway and turn to the right," he entered a door that had been propped open and shut it behind him, according to Cook County Jail spokesperson Cara Smith.

The man thought he was entering the visiting area to see his son, but the room is reportedly where people visit the “highest classification” super-maximum security prisoners and is not used on the weekends, according to the Chicago Tribune.