An inmate who escaped from the Gwinnett County Jail was arrested Thursday in Rockdale County after a police chase, officials said.

John Alexander Goodwin, 27, who was in jail on a probation violation charge, swapped identification with his cellmate, who was about to be released, the Gwinnett sheriff’s office said.

Hours after Goodwin was mistakenly released, deputies found out he was at a residence in Rockdale County.

When deputies arrived, Goodwin jumped into a nearby car and struck an assisting deputy with his vehicle, Deputy Shannon Volkodav, a spokeswoman for the sheriff’s office, said in a statement.

The chase ended with a crash on Highway 138 just inside the Conyers city limits about 2:30 p.m. Old Salem Road was temporarily shut down, Rockdale spokesman Officer Michael Meyers said.

VIDEO: Dashcam video from the end of the pursuit

Rockdale County Sheriff Eric Levett said one deputy was injured in the crash but is expected to be OK. Goodwin was taken to a medical treatment facility for injuries he sustained in the crash when the car rolled over, Volkodav said. He faces additional charges of false swearing and escape from jail.