Illinois police said the facility had been closed to the public since 2002, but the two girls managed to sneak in through a hole in the fence on Monday afternoon.
"About 2:45 p.m., they were wandering around the building when one of them managed to lock herself inside a cell," Joliet Fire Department Battalion Chief Mike Stromberg told The Herald-News. "They didn't call 911, but did call the fire department's front office."
Firefighters arrived at the scene in less than an hour and used a sledgehammer to break through a brick wall to set her free.
"Her jail time was about 45 minutes," Stromberg said.
The two girls will face trespassing charges for the incident, according to state police.