A foolish game of "chicken" among three "intoxicated" friends at Fairy Meadow train station ended in tragedy on Friday afternoon.
A man, believed to be aged between 35 and 45, was hit by a train and killed just before peak hour, throwing the start of the long weekend into chaos for commuters.
Police are treating the man's death as "misadventure".
Emergency services were called to the scene just before 4pm with reports of a fatality on the tracks.
About 300 passengers, many visibly upset, were evacuated from the carriages as emergency crews worked to recover the man's body.
NSW Ambulance's Illawarra duty manager, Norm Rees, said paramedics assessed two men who were with the victim and three railway workers including the train's driver.
Read more: How the Fairy Meadow train tragedy unfolded
He said the exact circumstances of the fatality would be determined by police.
"What I believe is we've got three males that were intoxicated and as a result of misadventure this guy has been hit by the train from the platform," he said.
The Mercury understands the victim stuck his head out towards the track, got hit by the train and was pulled underneath.
Paramedics tried to treat the two friends but they refused help and left the scene.
Insp Rees said a few witnesses were suffering shock but the driver was "alright".
"He's been checked out and he is coping with the situation," Insp Rees said.
"(There's a) few very, very upset people. I noticed a couple of pregnant women being removed from the train and it's tricky ... we don't want them to have to walk past the incident.
"A fair few people are were visibly upset."
Sophie Borgas told the Mercury she was sitting next to the window in the front carriage when the incident happened.
"I heard the train put on its brakes, we slowed down then I saw the man hit the window, he hit it a couple of times and bounced off the train," she said.
A distraught woman who lives near the train station said she heard a scream just before the fatality.
She said she rushed her daughter inside, then walked up to the train track and saw the body.
Passengers were transferred onto replacement buses as trains on both tracks of the South Coast line were suspended between Wollongong and Thirroul. Trains resumed about 5.30pm.