Lee Baca, the former Los Angeles County sheriff, was sentenced to three years in prison on Friday for orchestrating a multifaceted scheme to derail a federal investigation into his troubled jails.

The sentence, handed down by Judge Percy Anderson of the United States District Court, concluded a yearslong ordeal that eventually led prosecutors to convict several of Mr. Baca’s subordinates before targeting the former sheriff himself.

Prosecutors had previously failed to secure a conviction against Mr. Baca when a jury deadlocked in December. At that time, 11 jurors sought to acquit the former sheriff, while one believed him to be guilty.

Prosecutors chose to retry the case, and in March, another jury took less than two days to convict Mr. Baca, 74, on charges of obstructing justice and lying to federal investigators.