MILTON — King Middle School students and parents were locked in a room and had to use their problem-solving skills to escape within a limited time.

However, don’t worry: They were just experiencing the latest craze sweeping the country.

During the school’s Oct. 14 fall festival, attendees could be locked into three Halloween-themed escape rooms: an asylum, a mad scientist’s lab or an Egyptian mummy’s tomb. Within 15 minutes, participants had to find clues and solve puzzles to learn the password that would unlock the door.

The activity coincided with the school’s Science, Technology, Engineering, Arts and Mathematics initiative, School Principal Darren Brock said.

Before the festival, Brock said a school committee went to Escape on Palafox in Pensacola as a team-building exercise; they also got ideas for the school event.

“We wanted to do this on a middle school level,” Brock said. “This basically gets our kids to work as a team along with their parents. I think the parents (were) having just as much fun, if not more fun, than what the kids (were).”

Watching the kids work alongside their parents is exciting, the principal said.

“It’s just phenomenal to see them working together,” Brock said. “Here they are, working side by side, and it’s basically the students teaching the parents and parents teaching the kids.”