A car crashed through fencing along Interstate 15 near West Bountiful, landed on railroad tracks and was hit by a FrontRunner train Wednesday morning — but a Utah Highway Patrol trooper pulled the driver out of the vehicle just before it was struck.

“I think I got him out a second just before the collision,” said Trooper Ruben Correa at a news conference. “So at that point, I actually wasn’t really thinking. I was just doing my job.”

Correa was on another traffic call nearby when he was notified of the accident. He arrived to find the car on the tracks with the driver still inside.

“I saw he was unconscious, so I opened his door [and] explained to him we’ve got to get out,” Correa said. “He wasn’t responding. Then I heard the horn from a train.”

He estimated the train was traveling toward them at between 50 and 80 mph, and he was “a little bit concerned about that." Dashcam video shows Correa pulling the man out of the car just a second before the train struck.

“I’m still trying to process everything that happened,” Correa said. “I’m just very grateful that I was able to get him and and he’s alive and he’s back with his family now.”

He’s being hailed as a hero for his quick action. UHP Col. Michael Rapich tweeted, “An incredible and heroic action by Trooper Ruben Correa. We are so grateful that the driver and trooper are safe after this extremely close call. Well done Trooper Correa!!!”

UTA first reported that a Union Pacific employee pulled the driver to safety, but it turned out the rescuer was the UHP trooper.

Carl Arky, senior media relations specialist for the Utah Transit Authority, called FrontRunner operator Riley Nelson an “unsung hero” in the incident, noting that he “quickly and decisively” activated the emergency braking system upon noticing the vehicle on the track soon before impact.

“In those 21 seconds the train slowed from 79 mph to approximately 30 mph,” he wrote in an email to reporters Wednesday night. “By being attentive and diligent, he slowed the train just enough to buy the trooper the few precious extra seconds needed to extricate the driver from the vehicle on the track.”

Had Nelson not activated the emergency brake, “the outcome most likely would have been tragic,” Arky said.

The crash happened about 6:50 a.m. between Pages Lane and Parrish Lane when the man who was driving the car suffered “an unknown medical condition,” Correa said.

The FrontRunner line was closed between the Woods Cross and Farmington stations, and commuters experienced delays of 30 minutes or more as buses carried passengers between the two stations for about an hour.

Traffic was also delayed on I-15; one southbound lane was closed near the scene of the accident.