Harrowing footage of railroad workers saving a small boy from getting seriously injured or killed by an electrified rail in New York is making the rounds online.

The incident occurred earlier this month at a train station north of New York City near Tarrytown.

According to a press release by the Metropolitan Transportation Authority, a locomotive engineer named William Kennedy was heading southbound on the Hudson Line train on April 6 when he noticed something on the northbound tracks.

“Heading south towards Tarrytown when I noticed something on the tracks, and when I realized it was a child I immediately called in an emergency,” Kennedy said, per the release.

He slowed down his train, as did the crew approaching on the northbound tracks.

Surveillance footage was released from the front of the northbound train, which came to a stop with the young boy not far in the distance.

The boy was a 3-year-old named Waylon, a non-verbal child with special needs. He was heading toward an electrified third rail, prompting the northbound train’s assistant conductor, Marcus Higgins, to jump onto the track to recover the toddler.

“He’s in the gauge of the track at this point. So he’s in between the running routes. So we stopped the train. I was like, ‘I’ll jump out,’ got the door open, jumped out,” Higgins said, according to ABC 7.

Higgins yelled at the boy to get away from the third rail, but he could not reach him in time.

Luckily, Waylon climbed over a wooden safety plank on top of the electrified rail. Fox 5 also reported that the power may have been shut off before he came in contact with the rail.

Higgins arrived, scooped him up, and brought him back to his train.

“In the heat of the moment when you see a child in this situation, your first instinct is to make sure they’re safe,” Higgins said, per the release.

Two other railroad workers dispatched to assist in the recovery came upon the child’s mother and sister while en route. They were crying on a street corner, having already reported Waylon missing.

However, it was not long before the two workers — signal maintainers Christopher Fraina and Max Chong — learned that the child was safe and informed his family members. They then traveled with some police officers to the Tarrytown train station, where the family was reunited.

The tearful reunion inside a train was captured on the surveillance footage.

“With the bravery and calm comportment of superheroes, they averted a horrific outcome and saw to it that this little boy was not going to become a statistic. We salute their efforts and compassion, and heartily thank them for their dedication to the people we serve,” said Metro-North Railroad President Catherine Rinaldi at a recent event honoring the railroad workers, according to the release.