NORFOLK, Va. (AP) — A former Tidewater Virginia sheriff was sentenced Friday to 12 years in prison for bribery and money laundering.

Former Norfolk Sheriff Bob McCabe apologized to the court before the sentence was issued, news outlets reported. McCabe was ordered into custody in August after he was convicted of 11 counts of fraud, conspiracy and money laundering.

McCabe served as Norfolk’s sheriff from 1994 to 2017. He was already under federal investigation when he abruptly resigned in 2017 and was indicted two years later.

McCabe was accused of using his position to solicit bribes and campaign donations from people linked to two companies that had large Norfolk City Jail contracts. While McCabe admitted violating campaign finance laws and getting loans and gifts from businessmen, he denied taking bribes. He testified that he consistently waited until the last minute to file campaign finance reports and probably failed to report some contributions and expenditures, but claimed it was never intentional.

U.S. District Judge Arenda Wright Allen disputed McCabe’s claims that he’d simply made mistakes, calling his bribery scheme “sophisticated and very intricate.”

“In the court’s opinion, you were guilty beyond all doubt,” Allen said. “It’s not a mistake, it’s a crime — a 22-year crime.”