DARLINGTON, S.C. (AP) — Authorities say a quick-thinking driver thwarted a car-jacking by a jail inmate in South Carolina.

Arrest warrants say Ezekiel Stevenson yanked a driver from his car during a hospital visit on May 13. But the driver kept his key fob, shutting the engine down before the car could leave the lot. That led to a standoff with the 18-year-old inmate, who kept trying to lock the doors. Each time, the driver used the fob to unlock them for the officers.

Stephenson then managed to flee into the woods, dodging an officer’s gunshot, but he was found within the hour. He was in the Darlington County Jail on a hit-and-run charge. Now he’s back, on escape, carjacking and resisting arrest charges. His lawyer did not respond to a request for comment.