An inmate escaped from custody Tuesday evening after returning from a court appearance, but he was apprehended within three hours, the Cobb County Sheriff's Office said.

Anthony L. Pierce, 20, of Powder Springs, escaped on foot around 6:15 p.m. through a security gate that was opened temporarily so a vehicle could exit, according to preliminary reports.

Authorities told Channel 2 Action News that Pierce, who was in waist chains when he escaped, ran into the woods behind the jail, an area that borders residential neighborhoods.

He was caught around 9 p.m. in the perimeter of the jail complex, Sheriff Neil Warren said.

Pierce has been incarcerated since November 2010. He was arrested on a misdemeanor fighting charge. Once in jail, he also was charged with felony aggravated battery of a deputy, Channel 2 said.

He now faces escape charges.