A Berkeley County Sheriff's Office deputy arrested on federal weapons charge was released on bail after facing a judge Tuesday.

Tony Allen Riley, 60, of Goose Creek, was charged with two counts of selling a firearm to a prohibited person.

U.S. Magistrate Judge Bruce Hendricks set bail at $25,000 for Riley in a downtown Charleston courtroom, according to court records.

Hendricks also set certain conditions upon Riley's release, including that he not possess any weapons and ordered all weapons in his possession be removed by sundown Tuesday, according to court records.

Details regarding the charges remain unclear. The indictment was sealed and remained sealed Tuesday afternoon.

Riley was employed as a deputy during the incident and when he was arrested, according to the U.S. Attorney's Office. He had previously retired as a sheriff's captain.

If convicted, Riley could face up to 10 years in prison on each count and up to a $250,000 fine.

In 2012, Riley was demoted for his part in the release of James Sanders, a domestic violence suspect who walked out of the Hill-Finklea Detention Center and was at large for several weeks.

Riley filed a grievance over the discipline, but the demotion stood, according to news accounts.

Reach Natalie Caula Hauff at 937-5594 or Twitter.com/ncaula.