A Fairfield man escaped injury Thursday after his vehicle burst into flames along Route 3 in Liberty, police said.

The unidentified man was having engine problems with his vehicle and pulled over on the side of the road, according to social media posts by Maine State Police. He got out just in time “before fire erupted in the engine compartment,” police said.

A state police trooper happened to be driving by as the fire engulfed the vehicle, which was destroyed.