LEXINGTON, Ky. — A former Democratic lobbyist convicted of bribing a top official in the Kentucky attorney general's office was sentenced on Thursday to more than 2 ½ years in prison.

James Sullivan received two years and nine months and was fined $25,000 by U.S. District Judge Karen Caldwell.

"This kind of crime erodes the public's confidence in government," Caldwell said after issuing the sentence. "This eats away at the very fiber of our democracy."

Sullivan's trial last summer exposed the murky relationships among the state's power brokers. At one point, a former high-ranking Cabinet official alleged that an aide to former Democratic Gov. Steve Beshear pressured him to award a state contract as a reward for campaign donations.

Tim Longmeyer testified that he refused because he was already being bribed to keep the contract with another company. In handing down the sentence, Caldwell said the evidence in the case "suggests the ease at which influence can be peddled."

In March 2016, Sullivan met with Longmeyer, who at the time was the second-most-powerful law enforcement officer in the state as Andy Beshear's top deputy.

Sullivan, who did not know Longmeyer had already been busted by the FBI for an unrelated kickback scheme involving the state's employee health insurance plan, slipped $1,000 into the cup holder of Longmeyer's SUV while the two were discussing a possible state contract for some outside law firms. Longmeyer secretly recorded the transaction for the FBI. In the recording, Sullivan promises Longmeyer he will "do a little more (than the $1,000) if I can just get something going."

During the trial, Sullivan denied bribing Longmeyer, calling the payments friendly loans between friends. But Thursday, he apologized for what he called "a terrible mistake."

"I'm really embarrassed and ashamed of what has happened," Sullivan told the judge. "I can't tell you how sorry I am."

The verdict could also have political consequences, as Andy Beshear is seeking the Democratic nomination for governor this year. Prosecutors have said he did not know about the bribe or Longmeyer's other crimes, which include funneling illegal campaign contributions to Beshear's campaign. Last month, Beshear announced he had donated $14,000 from his 2015 campaign account to charity to atone for the tainted contributions. But Republican Gov. Matt Bevin and his allies often invoke Longmeyer's name as they try to taint Beshear's term as attorney general.

Longmeyer pleaded guilty in 2016 and was sentenced to five years and 10 months in prison.

Sullivan was originally charged with four bribery-related counts. The jury only convicted him on one count, the $1,000 recorded payment to Longmeyer in March 2016. That complicated the sentencing. Sullivan's lawyer said he was facing at least 10 years in prison under federal sentencing guidelines. But in an agreement with prosecutors, the government limited his sentence to between two years and three months and two years and nine months in exchange for Sullivan giving up his right to appeal.

Such agreements are rare for people who have been convicted by a jury. Caldwell said it was the first time she had seen such an agreement in 18 years as a judge.

Hectus argued for a sentence of two years and three months. He noted state taxpayers did not lose money because of the bribe, and Sullivan did not enrich himself. But prosecutor Andy Boone asked for the longest possible sentence given Sullivan's background as a veteran lobbyist and consultant.

"He is somebody who should have known better," Boone said. "This was a crime of choice."

Sullivan is scheduled to begin his prison sentence on March 19.