A Long Island Rail Road train plowed into a car driving on the tracks in East Rockaway on Monday — leaving the vehicle in a twisted heap — but the driver miraculously survived, MTA officials said.

The unidentified motorist somehow made it around a closed railroad crossing gate and onto the tracks near Forest and Rocklyn avenues in Nassau County some time after 3 p.m., and collided with the train, officials said.

Service on the LIRR’s Long Beach branch was suspended for about an hour as a result of the incident, but has resumed, the agency said on Twitter.

The driver was conscious and taken to a nearby hospital. No passengers were aboard the train he collided with.