A man who stepped onto a commuter train in Perth, Australia, Wednesday quickly realized his mistake as he tried to stand just inside the door. His foot slipped and became caught in the crack between the platform and the train door.

It wasn’t long though until a large group gathered and transportation officials were alerted to ensure the train would not move forward. But pull as they might, the man couldn’t budge. So how did they get him unstuck?

This is the consequence of not minding the gap. (Image source: YouTube)

This is the consequence of not minding the gap. (Image source: YouTube)

Eventually, the platform crowded with people and officials organized dozens of passengers on the scene to push the train to the side, moving it just enough to free the man’s foot.

Commuters all pitched in to rock the train to one side to free the stuck man. (Image source: YouTube)

Commuters all pitched in to rock the train to one side to free the stuck man. (Image source: YouTube)

Watch the footage:

“He seemed to be a bit sheepish, because right where he fell was the ‘mind the gap’ writing,” Nicolas Taylor, a person who helped push the train, told Perth Now.

The whole rescue operation only took about 10 minutes.

“They did a really good job, they took control and handled it well,” Taylor told the news site of the transportation officials’ coordination of the situation. “When I first saw it I thought we’d be there for hours.”

Afterward, Taylor said the man was able to walk away from the scene and thus appeared “reasonably OK.”

“It’s really heartwarming I think, to find an incident like this where everyone pitched in,” David Hynes, a spokesman for the Western Australia State Public Transport Authority, said.

(H/T: Australian Broadcasting Corporation)

The Associated Press contributed to this report.