The pilot of a small plane was lucky to avoid death twice on Sunday – first when he crashed into train tracks in Pacoima, then when Los Angeles police pulled him out of the plane seconds before an oncoming commuter train crashed into the plane.

An LAPD officer body camera footage captured the dramatic sequence of events, showing police working to free the pilot from the wreckage as the horn of an oncoming Metrolink train blared.

“Go, go, go, go, go!” a man can be heard shouting as the train headed towards the group.

Just after officers pull the man out of the plane, the train can be seen hurtling through the plane, splitting its fuselage in two.

The incident took place shortly after 2 p.m. on the Metrolink Antelope Valley Line train tracks near Whiteman Airport in Pacoima, the LAFD said in a pair of alerts.

The single-engine plane – its tail number of N8056L identifies it as a 1967 Cessna 172H, according to the FlightAware website – had lost power and crashed near the intersection of San Fernando Road and Osborne Street, according to the LAPD Valley Office.

“I saw the plane go down,” said Sgt. Joseph Cavestany, one of the officers who helped rescue the pilot, told reporters at a news conference. “Looked like he was off…I’ve ordered our comms to shut down all rail activity.”

Officer Christopher Aboyte said upon arriving at the scene of the plane crash he began speaking with the pilot to try to keep him alert and conscious.

Then came the sound of bells and flashing lights, signaling an oncoming train, officers said at the press conference.

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

The pilot’s wife told KTLA on the phone Monday that she was grateful to the officers who saved her husband’s life.

“Thank you from the bottom of my heart,” she said. “They saved his life… If he had been on the plane again, it would have been a horrible event.”