The rescue of a young girl from under a New York City subway car after her father committed suicide was caught on video by onlookers.

The incident occurred during the Monday morning rush, when an unidentified 45-year-old Bronx resident arrived at Kingsbridge station with his 5-year-old daughter and then jumped in front of the train as it pulled up with his daughter in hand. The man was killed while his daughter became trapped underneath the front train car.

After the train came to a full stop, two bystanders at the station jumped onto the track to help get the girl to safety. The two initially struggled to get her out but were able to safely rescue the trapped girl and hand her off to bystanders on the platform until emergency responders arrived.

While the pair worked to get her out safely, onlookers on the opposite track began recording the rescue and posted it online shortly after.

The young girl rested on a platform bench until emergency responders arrived, where she was seen being carried to an ambulance by a first responder. She was quickly rushed to nearby Jacobi Medical Center where she was treated for a reported broken leg. Her two rescuers were also brought to nearby hospitals to be treated for minor injuries.

“This is a tragedy and our thoughts are with the family members as well as with our train operator — this is a traumatic event for everyone involved,” Metropolitan Transportation Authority spokesman Shams Tarek said in a statement.

This is a representational image of the subway stop in Manhattan, New York, Dec. 5, 2012 Spencer Platt/Getty Images