SAN FRANCISCO (AP) — A federal judge sentenced former California state senator Leland Yee on Wednesday to five years in prison after he acknowledged in a plea deal that he accepted thousands of dollars in bribes and discussed helping an undercover FBI agent buy automatic weapons from the Philippines.

Senior District Court Judge Charles Breyer called the weapons allegations against Yee – a gun control advocate -unfathomable and said it was frightening that Yee would be willing to go entirely against his public position on guns in exchange for money.

“I don’t feel I should be lenient,” Breyer said during the hearing. “The crimes that you committed have resulted in essentially an attack on democratic institutions.”

Still, Breyer’s sentence fell on the low end of guidelines that called for a prison term of between four years and 9 months and six years.

Prosecutors had recommended an eight-year sentence.

Yee’s attorneys had called for no more than five years and three months behind bars, saying Yee had a history of public service and his wife was ill.

Yee, 67, told the judge before sentencing that he had accepted responsibility for his crimes and wanted to take care of his disabled wife.

“Nothing will ever take away those crimes and those actions,” he said. “Nothing that I will ever do will take away the pain that I have caused to my family friends, constituents, supporters.”

Yee has been free pending sentencing. Breyer ordered him to surrender in 30 days. Yee and his attorney declined comment outside the courtroom.

Yee is a long-time politician who also served in the state Assembly and on the San Francisco Board of Supervisors.

He pleaded guilty in July to one count of conspiracy to engage in racketeering. The charge was filed as part of an organized crime investigation in San Francisco’s Chinatown that led to charges against more than two dozen people.

The probe also snared Raymond “Shrimp Boy” Chow, a flamboyant leader of a Chinese fraternal organization – the Ghee Kung Tong.

Federal agents say one of Chow’s associates was Keith Jackson, a former San Francisco school board president and well-known political consultant who raised money for Yee’s unsuccessful mayoral run in 2011 and his bid for secretary of state.

Prosecutor Susan Badger said during the sentencing hearing that Yee was looking for money to win the race for secretary of state as he was being forced from the state Senate by term limits.

“Senator Yee abused that trust and faith in the worst possible way. it wasn’t actually for personal financial wealth,” she said. “It was to retain power as a public official.”

Jackson led authorities to Yee and pleaded guilty to a racketeering charge. He received a nine-year prison sentence Wednesday.

Yee acknowledged accepting $11,000 in exchange for setting up a meeting with another state senator, $10,000 for recommending someone for a grant, and $6,800 for providing a certificate on California State Senate letterhead honoring the Ghee Kung Tong.

He also acknowledged that he discussed helping an undercover FBI agent buy automatic weapons from the Philippines that were intended to be brought to the U.S. for distribution.

Prosecutors say Chow and some other members of the fraternal group engaged in drug trafficking, money laundering and the sale of stolen cigarettes and top-shelf liquors.

The case against Chow was largely the work of an undercover FBI agent who posed for years as a foul-mouthed East Coast businessman with mafia ties.