LOS ANGELES (AP) — Former Los Angeles Sheriff Lee Baca was sentenced Friday to three years in prison for obstructing an FBI investigation into abuses at the jails he ran.

The 74-year-old Baca, who is in the early stages of Alzheimer's disease, was sentenced by a judge who has shown little leniency when it comes to Baca's role atop a department rife with corruption.

U.S. District Court Judge Percy Anderson said he would have sentenced Baca to five years in prison except for his years of service and the Alzheimer's diagnosis.

The judge, however, took exception to a defense contention that Alzheimer's is a sentence of its own.

"As awful as Alzheimer's diseases, it's not a criminal penalty," Anderson said. "Alzheimer's disease is not a get-out-of-jail card."

Baca was ordered to turn himself in July 25 to begin serving his sentence.

As he walked out of the courthouse Friday morning, Baca told reporters that it had been "an interesting day" and thanked his supporters for standing by him.

"For 48 years, he served the people of Los Angeles with all his might, with all his heart," his attorney, Nathan Hochman, said. "He gave it his all, all the time."

The lawman, who worked his way up from guarding inmates to running the nation's largest jail system — and largest sheriff's department — was convicted in March of obstructing justice, conspiring to obstruct justice and lying to federal authorities.

Baca abruptly resigned in 2014 as the probe netted several underlings who plotted to hide an inmate informant from his FBI handler when they learned the jails were being investigated. Baca had learned of the probe after a cellphone that the informant used to communicate with his handler was found in his jail cell, prosecutors said.

"I will never accept a cellphone in the county jail given to a career criminal. I don't care who gives it," Baca said.

The crimes tarnished Baca's reputation as a man on a mission to promote education and rehabilitation behind bars and who preached tolerance and understanding between people of different cultures and faiths.

The case made it difficult to reconcile the image of the soft-spoken, rail-thin, Zen-like reformer with the man who told the local FBI head and top federal prosecutor he was ready to "gun up" for battle with them and furiously stated: "I'm the goddamn sheriff, these are my goddamn jails."

Baca, who jetted around the world to speak about his approach to law enforcement, denied any involvement in the scandal, but acknowledged he had fallen out of touch with what was happening in his department. But prosecutors said he had turned a blind eye to problems at his jails, including vicious beatings by guards who covered up the abuse by falsifying records.

Baca's "crimes showed that corruption went all the way to the top," Assistant U.S. Attorney Brandon Fox wrote in sentencing papers suggesting a two-year prison term. "Instead of acting as a leader, Baca distanced himself from the actions of his subordinates, and lied about his own conduct."

Prosecutors also won convictions against 20 other members of the department for crimes ranging from assaults by rank-and-file deputies to the department's second-in-command, Paul Tanaka, who oversaw efforts to derail the federal probe.

While Tanaka, also convicted of the obstruction and conspiracy charges, was sentenced to five years in prison, prosecutors said Baca deserves the lighter term because there was no evidence he tampered with witnesses and Tanaka fostered a culture of corruption. They also cited Baca's degenerative disease.

Baca had originally pleaded guilty to a single count of lying to federal investigators in a deal that would have required no more than six months in prison. But when Judge Percy Anderson rejected that as too lenient, Baca withdrew his plea.

Prosecutors then hit him with the two additional obstruction counts. At Baca's first trial, a jury deadlocked 11-1 for acquittal and a mistrial was declared. He was convicted three months later by a different jury at his second trial.

Defense attorney Nathan Hochman said Baca's misdeeds over six weeks in 2011 and four false answers to 400 questions during a voluntary interview with authorities in 2013 must be weighed against an "extraordinary record of public service" over 48 years and along with his condition, which has progressed from mild cognitive impairment to mild dementia.

More than 200 friends and supporters wrote letters of support to the court on behalf of Baca, including former Mexican President Vicente Fox, former California Govs. Arnold Schwarzenegger and Gray Davis, former Los Angeles Ram-turned-minister Rosey Grier, former Dodgers manager Tommy Lasorda, Hollywood executives, former jailbirds — even a public relations executive whose firm represents the deputies union that has been critical of Baca.

They hailed his unconventional style of policing, his compassion and a lifetime of good works.

Hochman plans to appeal, challenging several of Anderson's rulings that he said were improper and showed bias toward Baca, including a decision not to allow medical experts to testify whether Baca's medical condition impaired his memory when he lied to federal authorities.

"This diagnosis is a sentence of its own," Hochman wrote. "In this case, a sentence of imprisonment is essentially a cognitive death sentence given the progression of Mr. Baca's Alzheimer's disease."