Los Angeles police officers pulled an injured pilot from the wreckage of a small plane that crash landed on railroad tracks just moments before a commuter train smashed into the aircraft over the weekend.

Bodycam video showed the officers working furiously Sunday afternoon to disentangle the bloodied pilot from the cockpit of the crumpled Cessna 172.

Also read: NFL Black Monday: Miami Dolphins fire head coach Brian Flores

“Go! Go! Go! Go! Go!” someone yelled as the officers dragged the man away seconds before the Metrolink train, its horn blaring, barreled through the plane.

The plane crashed shortly after takeoff at 2:10 p.m. from Whiteman Airport in the San Fernando Valley community of Pacoima, according to the Federal Aviation Administration. The timestamp on a police officer’s body camera showed that the train hit the plane at 2:15 p.m.

The plane had landed on the tracks at a railroad crossing just blocks from the Los Angeles Police Department’s Foothill Division station, and officers arrived at the crash scene almost immediately.

Also read: American Airlines seeks apology for pilot with ‘Let’s Go Brandon’ sticker

CBSN Los Angeles said four officers extricated the pilot and drag him onto the pavement. The station identified them as Damien Castro, Christopher Aboyte, Robert Sherock and Sgt. Joseph Cavestany.

It was unclear how much time passed before authorities realized the plane was on the tracks, or exactly when police notified the railroad, but the officers realized there was no time to spare.

“I had requested Metrolink to cease all train activity, but apparently that didn’t happen,” Cavestany said.

The male pilot was the only person on board and was taken to a hospital for treatment, the Los Angeles Fire Department said. He was not identified and no other injuries were reported.

Also read: Technology sector leads stocks lower again on Wall Street

“Seeing what happened, I’m grateful to be alive. I’m grateful the pilot survived as well,” Sherock said.

Metrolink subsequently halted train service and road traffic was detoured in the area about 20 miles (32 kilometers) northwest of downtown Los Angeles. The FAA and the National Transportation Safety Board will investigate.