ATLANTA (WFLA) — A police chase soon led to a rescue operation after a suspect in a stolen patrol car crashed and almost got himself hit by a train.

Videos released by the Atlanta Police Department showed that the Jan. 28 incident first began when Mickal Parker stole an officer’s patrol car while he was giving a warning to a separate driver in a traffic stop.

“Yo, back up! Get out of the car!” the officer is heard yelling at Parker before he sped off.

Atlanta police pursued the stolen patrol car before Parker crashed and flipped the car onto the train tracks at the intersection of McDonough Boulevard and Hank Aaron Drive.

As officers worked to get Parker out of the vehicle, they realized a train was heading their way.

Just moments before the train hit them, officers pulled Parker out of the car, saving both his life and their own.

Parker was charged with theft, fleeing and eluding, reckless driving, obstruction, and damage to city property.