LOS ANGELES -- Former Los Angeles County Sheriff Lee Baca withdrew a guilty plea Monday and chose to go to trial on a charge of lying to federal authorities in an effort to thwart an FBI investigation into abuses at the jails he ran.

The decision was made at a hearing after last-minute negotiations between defense attorneys and prosecutors on a new plea agreement.

Baca, 74, who is suffering from Alzheimer's disease, had pleaded guilty to lying to federal authorities under a deal that called for no more than six months in prison. But a federal judge rejected that sentence last month as too lenient, saying it failed to address Baca's "gross abuse of the public's trust."

Get Breaking News Delivered to Your Inbox

Negotiations continued through the weekend to find a compromise that would suit Baca, federal prosecutors and the judge.

"It's frustrating for (Baca) because he's looking for a degree of certainty. He wants this very much to be over," defense lawyer Michael Zweiback said before the decision was made. "If he's not going to be in a situation where he has some understanding of what he's walking into, then he may feel he has no alternative but to fight for his life and go to trial."

One of the main challenges was uncertainty about what term would satisfy the judge. Federal court rules bar judges from taking part in plea negotiations, and Zweiback said Judge Percy Anderson did not provide a number of months or years that would satisfy him.

Prosecutors cannot mention the prior guilty plea in the trial.

The prospect that Baca will go through a public trial is another dramatic twist in a corruption scandal that blossomed after his deputies learned an inmate was an FBI informant.

Baca, who cut the figure of a fit, trim military officer in a crisp khaki uniform during his 16-year reign, was known for his unconventional approach to running the nation's largest sheriff's department. He jetted around the world to promote a softer style of law enforcement, advocating for jailhouse education and a better understanding of different cultures.

But in his jails, a band of rogue deputies was beating inmates, and supervisors were helping cover up the violence.

After discovery of the FBI mole who was trying to gather evidence of beatings, Baca and other higher-ups allegedly tried to derail the investigation, having underlings shuffle the inmate to different jails under different names and trying to intimidate an FBI agent.

Baca long denied any role in the scandal and claimed he was out of touch with the goings-on in the jails. In his guilty plea, he acknowledged ordering deputies to "do everything but put handcuffs on" a female agent.

More than 20 members of the department have been convicted on charges ranging from assault to obstruction of justice, including his former second-in-command, who was sentenced to five years in federal prison.

Anderson surprised many court observers when he rejected the plea deal.

"It's one thing to lie," Anderson said. "It's another thing entirely ... when the chief law enforcement officer of the county of Los Angeles is involved in a wide-ranging conspiracy to cover up abuse and corruption."

One factor that might have come into play in the decision-making for Baca's attorneys is the state of Baca's mind.

Doctors have said he's in the early stages of Alzheimer's and able to function. But he will probably experience severe cognitive impairment in five to 10 years.

"He's going to be locked up during the healthiest period of his life ... and certainly the most aware period that he's got left," said attorney J. Vincent Aprile II, who has written about defending elderly clients.

Withdrawing the plea and forcing prosecutors to get a grand jury indictment and go to trial would buy Baca more time as lawyers prepare for trial.

If his condition declined during that delay, he could be deemed incompetent to stand trial or appear as a sympathetic figure to a jury and be acquitted.

Discussing the prospect with Baca that any delay would allow him to remain free before his mind diminishes, however, would be a tough task, said defense lawyer Steve Cron, who is not involved in the case.

"I'm not saying it's not going to happen, but that's not a conversation I'd ever want to have with a client," Cron said. "That's a pretty grim choice."

Another risk in going to trial is that prosecutors have said they would seek a more punitive obstruction of justice indictment, Zweiback said.