SPRING, Texas — A dump truck driver is lucky to be alive after getting stuck on railroad tracks as a train approached in Spring Wednesday.

“Thank goodness everything stayed on the rails 'cause there were HAZMAT cars on that train,” said District Chief Chris vonWiesenthal of the Spring Fire Department, while watching the dashcam video.

VonWiesenthal responded to the scene Wednesday morning.

“This is nothing short of a miracle that people were not injured in this incident,” vonWiesenthal said.

He said the truck driver did the right thing by steering toward the shoulder to avoid colliding with another car and potentially pushing it onto the tracks.

“She was upset,” vonWiesenthal said. “That was her dump truck, and it’s her company, and she felt bad that it happened. She felt bad that she totaled out her dump truck but she was elated, like we all were, that nobody was injured.”

Maddy Nguyen and her husband saw the whole thing while sitting at a stoplight at Kuykendahl and Kuykendahl-Hufsmith.

Their dashcam was rolling when the dump truck driver lost control, skidded off the road and onto the railroad tracks.

The crossing bar was already down, the lights were flashing and the train was fast approaching.

“Oh my God, oh my God!” Maddy screamed as the train barreled toward the truck.

The driver jumped out just in the nick of time and he wasn’t hurt.

The chief said the conductor and engineer on board the train were “shaken up” but OK.

He also said Union Pacific’s hazmat team cleaned the tracks after finding no leaks or damage from the wreck then re-opened them to freight traffic.

The tracks are right across the street from the home of Douglas Underbrink, who says he was not surprised the incident happened because crashes are common.

“Look at how many marks are on that curb, and they just painted it not too long ago again,” Underbrink said.

KHOU left a voicemail message at a number registered to the truck and visited an address also listed but were not able to reach the owner.

Harris County Sheriff’s Office is investigating the crash.

ALSO POPULAR ON KHOU.COM