BETHPAGE, N.Y. (CBSNewYork) — An Uber driver had a close call in Bethpage Tuesday, as he found his car stuck on the railroad tracks just as a Long Island Rail Road train was heading his way.

As CBS2’s Erin Logan reported, the smashed-up car seen pressed up against the train evoked thoughts of the worst. But Uber driver Hugh James escaped with his life just in time.

The crash occurred just after 7 a.m., halting service on the Ronkonkoma branch in both directions east of Hicksville.

James said he was trying to cross the tracks on Broadway just east of the Bethpage Station when his car suddenly got stuck. He said something likely became wedged under the car.

James said he always slows down as he approaches train tracks, but he said this time, it was out of his control. There was something clearly wrong with his car.

“I tried to move forward, I couldn’t. I put it in reverse, it would not. I then turned the wheel right and put it in drive and stepped hard on the gas and it jumped forward,” James said.

That’s when he looked up and noticed a stranger trying to help.

“He tried to push the car while I put it in reverse and it would not move. He then saw the train coming,” James said.

James jumped out and took a look underneath the car to see if there was something that caused it to get stuck, but he knew he had to get out of the way fast.

“I tried to signal the train, he couldn’t see me so I cleared the area and the car was hit,” James said. “It was a mess.”

Before he knew it, the train plowed right into James’ car. A nearby surveillance camera captured the flash as the train hit James’ Honda Accord.

An area business owner did not know what to expect, since this has happened before.

“When we were walking out, we could see flames from under the train, so we knew it hit a car,” said Bob Schoppman of Bob and Fred Bethpage Autobody. “There have been some fatalities here.”

Schoppman was relieved to see the driver was just fine.

As for James, he said he doesn’t know what would’ve happened had this stranger not stepped in to help. He credits that good Samaritan for getting him out of the car just in the nick of time, alerting him that the train was coming.

“Unfortunately, I didn’t get his name. But he was there,” James said.

Normal service resumed a few hours after the incident. The LIRR said after investigating, no debris was fond found on the tracks that would cause the car to get stuck.

James was given a summons for obstructing a rail grade crossing.