A few weeks ago, Thomas J. Thompson seemed assured of keeping his job as an Erie County sheriff’s deputy, even though he took part in beating an inmate in the Erie County Holding Center.

Thompson, as punishment for his crime, was ordered to serve eight months in federal custody with a recommendation from the judge that he do his time at a halfway house in Buffalo.

It was a sentence that would have allowed Thompson to keep his badge, a prospect that Sheriff Timothy B. Howard called “frustrating” and one that now may be changing because of the agency in charge of federal prisons.

The U.S. Bureau of Prisons wants Thompson to serve his time in Lexington, Ky., which means Thompson may again face dismissal if he cannot appear for work each day.

“Whether he’s at a maximum facility, a minimum facility or a camp doesn’t really matter,” said James W. Grable Jr., Thompson’s lawyer. “It’s a sentence that will cost his wife and daughter their financial future.”

Grable was in federal court Wednesday urging U.S. Magistrate Judge H. Kenneth Schroeder to change his original sentence so that Thompson can remain in Buffalo and keep his job.

Schroeder rejected his request and made it clear that where Thompson serves his sentence is beyond his authority as a judge.

Thompson’s appeal to the court also coincides with a renewed effort by Erie County to dismiss him.

Schroeder mentioned the county’s interest in terminating Thompson on Wednesday, and Undersheriff Mark N. Wipperman later confirmed that the Sheriff’s Office has received legal opinions from the county’s Law and Labor Relations departments regarding Thompson.

He said the opinions address Thompson’s previous termination – his firing was overturned by an arbitrator – and the possibility of “double jeopardy.”

“We received those opinions back, and a ‘second’ decision will be made very soon in regards to Deputy Thompson’s employment status,” Wipperman said in a statement.

Thompson’s legal woes stem from his involvement in a Jan. 18, 2010, assault on Stephen Heilmann, an inmate at the Holding Center.

As part of his plea deal, Thompson admitted recruiting other deputies to assist him in punishing Heilmann, who he says lied to guards about drugs at the jail.

When a search of another inmate’s cell failed to turn up any drugs, Thompson and the other deputies returned to Heilmann’s cell and told him that because he lied, he had to take a punch to the gut.

Thompson then told Heilmann to pick out a deputy to deliver the blow. He did so, and a deputy then punched him. Heilmann later sued the county and won an out-of-court settlement.

An official with the bureau indicated in court papers that it has a policy of placing law enforcement personnel sentenced to federal custody in facilities outside their community because of the risk of being close to inmates they may have investigated, arrested or prosecuted.

Grable said Thompson has been ordered to report to the facility in Kentucky by next Thursday.