A motorist was ticketed Wednesday morning after North Charleston police said he did a U-turn on some train tracks and got stuck there before he and his passenger jumped from his car as a locomotive approached.

The front of the CSX train's engine, which had several cars attached, struck the car, but no one was injured in the crash around 6:30 a.m., North Charleston Police Department spokesman Spencer Pryor said in a statement.

The 18-year-old man had been driving westward in his Cadillac on East Montague Avenue when Pryor said he tried to turn left onto Gaynor Street near the Ferndale community.

"Somehow, the driver ended up on the railroad tracks and attempted to U-turn to get off of the tracks," Pryor said in the statement.

But with the sedan's two right wheels stuck between the rails, the driver could not free the car in time.

"Seeing the approaching train, the driver and passenger exited the vehicle" before it struck the Cadillac's rear end, Pryor said.

The roads were closed to traffic in the area until about 9 a.m., Pryor said.

The motorist was cited with careless operation, which is a traffic ticket. He was not named in the police department's statement.

Reach Andrew Knapp at 937-5414 or twitter.com/offlede.