Lights, camera… run.

Frightening footage of five children narrowly escaping an oncoming train moments after posing for photos on active railroad tracks has gone viral.

On Monday, a two-minute clip of what could have been a tragic accident hit YouTube, shared by locomotive enthusiast account Virtual Railfan. Footage of the family’s close escape from the barreling train’s path has since been viewed nearly 70,000 times.

NIGHTMARE BEFORE CHRISTMAS: FAMILY STAGES 'TOTAL DISASTER' HOLIDAY PHOTO SHOOT

According to Virtual Railfan, which describes itself as "the premiere provider for live train cams all over the U.S.,” the incident occurred on Sunday in Greencastle, Pa.

In the video, five children sat, walked and romped around two tree-lined train tracks, while two adults, likely their parents, consulted with a photographer who clicked away. About one minute into the clip, as the kids were scattered all over the tracks, one of them screamed “Here comes the train!”

The youngsters shrieked and ran to safety on the sides. For a terrifying second, the smallest child struggled to get out of the tracks as the train blazed forward, before another one of the kids sprinted to pull him out of harm’s way.

“Just stay right here!” an adult shouted. Fortunately, all of the people were out of the frame when the train came.

The incident reportedly occurred on Feb. 23 in Greencastle, Pa. (iStock)

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

“Please, please, please stay off the tracks and railroad property! This could have been beyond tragic!” Virtual Railfan urged.

According to the U.S. Department of Transportation, there were 560 trespasser fatalities on railroad tracks nationwide in 2017, an increase of 80 from the previous year. The trend in rail trespasser fatalities has "substantially increased," with a 25 percent increase over a decade, according to the agency.

In November, a 17-year-old Oregon boy was struck and killed by a freight train that barreled through while he was near a train bridge to pose for senior photos, officials said.

CLICK HERE TO GET THE FOX NEWS APP

Fox News’ Travis Fedschun contributed to this report.