This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

MOKENA, Ill. — A Mokena police officer’s quick thinking helped him avoid getting struck by a Metra train.

Officer Peter Stanglewicz recently shared dashcam footage of the November incident on Facebook, and it has been viewed over 500,000 times.

Police say Stanglewicz was traveling westbound on 191st Street in Mokena when he observed an inbound train approaching the rail line’s crossing. The gates and lights at the crossing had not activated.

Stanglewicz turned a hard left to avoid colliding with the train, causing his squad car to cross the median and rest in the eastbound lanes of 191st Street. just as the train cleared the crossing.

The video shows that another vehicle barely missed getting struck by the train as well.

Metra said the gates and lights didn’t activate due to an electrical short that has since been fixed.