Dozens of people helped rescue a fellow commuter in Australia by pushing against a train car to free the man whose leg slipped between the platform and the train.

Closed-circuit footage released by the Western Australia State Public Transport Authority showed the man lost his footing while boarding the train at a station in the city of Perth on Wednesday.

A passenger alerted railway staff who stopped the train from leaving, local media said. When railway workers realized the man couldn't move, they called on other passengers to help.

Story continues below advertisement

The footage showed dozens of people rushing to help tilt the car to free the man, who fell at least thigh-deep into the platform gap.

"It's really heartwarming I think, to find an incident like this where everyone pitched in," transport authority spokesman David Hynes said.

The man wasn't named, but local media reported that he was believed to have escaped injury and caught the next train.