Atlanta firefighters were called to Phipps Plaza Thursday morning to rescue a man whose foot got caught in an escalator in the mall’s parking deck.

The man was conscious and alert when firefighters arrived with heavy equipment to remove his right foot from the escalator.

It took rescuers about an hour to free the man’s foot, and he was taken by ambulance to Grady Memorial Hospital.

Atlanta fire Capt. Marian McDaniel told the Atlanta Journal-Constitution that the man, who is in his 30s, was at the mall to work on the sprinkler system.

He was carrying a ladder up the escalator when “the ladder somehow slipped and created a wedge in the stairs of the escalator and that’s what his foot got caught in,” McDaniel said.

She said the man was working with a partner who was ahead of him on the escalator.

“The partner did not know what happened until he heard him screaming, turned around and saw him, and at that point went to get help and to cut the power on the escalator,” McDaniel said.

She said the victim “was in a lot of pain” when firefighters arrived.

“It took some time, but they did get him out successfully,” McDaniel said, adding that firefighters used blocks of wood “to create a big enough wedge to be able to pull his foot out without causing any more pain than necessary.”