BARRIE -- A few terrifying moments for a mother and her two children as they escaped from a stalled BMW SUV moments before it was struck by a train in Alliston.

It happened just before noon on Friday.

Jenna Smith, a witness to the crash, says she was watching from a nearby restaurant window when the vehicle stopped on the tracks with four-way lights activated.

“You saw tons of people trying to get the vehicle moving, to get it off the tracks,” says Smith, “and just like the sounds there, those started to go off and everybody was like, get the kids out of the car, mom out of the car.”

According to the police, the train operator was contacted and was able to slow down just before the impact, but couldn’t stop.

Police and Canadian Pacific Railway officials are investigating the cause of the crash.

The train has been moved from the intersection, but CP investigators are still inspecting the train.

The intersection was reopened just before 6pm.

With files from CTV's Mike Arsalides.