Dozens of people helped rescue a fellow commuter in Australia by pushing against train carriages to free the man whose foot had 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's foot was stuck in the 5-centimetre gap, they called on other passengers to help.

Trapped Commuter

The man's foot was stuck between the train and the platform. (ABC News)

Transperth spokesman David Hynes said the man boarded the train near the end of rush hour but the train was still busy.

"He stood in the doorway and as he was sort of taking up his position there, one leg slipped outside the door, slipped outside the gap, and he was stuck," he said.

"We alerted the driver, made sure the train didn't move.

"Then our staff who were there at the time got the passengers, and there were lots of them, off the train, and organized them to sort of rock, tilt the train backwards away from the platform so they were able to get him out and rescue him."

The footage showed dozens of people rushing to help tilt the carriages to free the man.

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

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

With files from ABC News