By Jeremy Ross

CHICAGO (CBS) — A Metra train nearly hit at least three cars, including a police cruiser, at a crossing in south suburban Mokena last month, after the crossing gates failed to warn drivers of the oncoming train.

Mokena Police Officer Peter Stanglewicz recorded the near-miss on the dashboard camera of his squad car and posted the video on Facebook. In his post, Stanglewicz said he’s never been a lucky guy, but he might have used up what little luck he had in those terrifying moments.

Around 8:45 a.m. on Nov. 9, Stanglewicz was headed west on 191st Street in Mokena, a few car lengths behind an SUV, when a Metra Rock Island Line train sped through the crossing between them. The officer saw that the gates and lights at the crossing did not activate as the train was approaching, and took a hard left turn to avoid being hit by the train. His squad car crossed the raised center median on 191st Street, and stopped in the eastbound lanes as the train went through the crossing.

Mokena officials said the officer was not injured. Neither were any other motorists who were driving near the crossing at the time.

The video posted on Facebook also shows a Metra maintenance worker stationed at a signal bungalow across the tracks from where the officer stopped his car. Metra said the worker had arrived on the scene a few minutes before the incident, due to an unrelated issue. The train’s operator hit the emergency brakes and called a dispatcher when he noticed the problem with the gates.

According to Metra, the train’s horn sounds when the emergency brakes are applied. No other incidents were reported at the crossing after the near collision, and the malfunction at the crossing was repaired by 3:40 p.m. that day.

The sight of the near collision shocked other drivers who often cross the same tracks.

“That’s too close; way too close,” driver’s education teacher Craig Marek said.

Metra said a rod in a hand throw switch shorted, causing the gate to fail. The problem was repaired a few hours later.

“If that happened to me with my kids, I would be mortified. I would probably never go that way again,” Marek said.

Marek said what the video shows is a reminder to practice what instructors preach, and always slow down at rail crossings.

Robin Campbell said she drives over that crossing all the time.

“I’m also going to be looking both ways on those train tracks before I cross them,” she said.

Metra said it takes incidents like this one very seriously, and procedures are in place to make sure nothing like this happens again.