State Sen. Leland Yee did not want to retire.
His term was ending, and he had just run and lost a mayor's race in San Francisco. He decided to aim for secretary of state, which oversees state elections, and desperately needed to raise money for his campaign.
That is when Yee, 67, got into trouble.
The San Francisco Democrat was caught in an FBI sting that recorded him promising votes and guns to an undercover agent who was funneling him contributions. He pleaded guilty last year rather than face a trial.
And Wednesday, after decades as an elected officeholder, he was sentenced to five years in prison for doing political favors in exchange for campaign cash — or, as the judge put it — for selling his vote.
During an hourlong hearing, Yee implored U.S. District Judge Charles Breyer to be lenient. Standing at a lectern near his lawyers, Yee said he had taken responsibility for his crimes and knew that he had shamed himself and hurt his family, his supporters and others.
"That will always weigh on me," he said, "and that will always haunt me for the rest of my life."
Yee also told the court that his wife was severely ill and needed him to care for her.
"I hope that in your sentencing of me, you will look at my entire life and not just these crimes I have committed," Yee said. "In the 67 years of my life, I have devoted much of it to the work of the community, to people here in San Francisco and in the state of California."
Breyer replied that he was not inclined to be lenient, telling Yee that he had been "hypocritical." Yee had promised an undercover agent to arrange an illegal shipment of guns, even though Yee publicly presented himself as a gun control advocate. The judge said Yee's actions were "vile" and besmirched his former office.
"It must be that the public has trust in the integrity of the institution, and Mr. Yee, you abused that trust," Breyer said. "You showed you did not have integrity in your actions."
The five-year sentence was within the term recommended by federal sentencing guidelines. Prosecutors had sought eight years. They said that Yee had received tens of thousands of dollars in campaign contributions in exchange for favors and that he admitted he knew his actions were illegal.
Yee abused the public trust "in the worst possible way … to retain power as a public official," Assistant U.S. Atty. Susan Badger told Breyer. "Fellow legislators are looking to see what the sentence will be. They are watching. They are aware."
Yee was ensnared by an FBI investigation that spanned several years and led to the convictions of Raymond "Shrimp Boy" Chow, a reputed Chinatown mobster, Keith Jackson, a former school board president and fundraiser for Lee, and others.
Jackson received a nine-year sentence. Chow faces a life term when he is sentenced next month.
Ethics experts generally applauded Yee's sentence, saying it sent a needed message.
"The public should be assured officials who violate the public's trust will be held accountable, and those of us who are tasked with holding officials to the highest ethical standards will be vigilant in doing so," said Jodi Remke, chairwoman of the state Fair Political Practices Commission.
Jessica Levinson, a Loyola Law School professor and president of the Los Angeles City Ethics Commission, said it was important that the judge recognized that Yee's crimes were not victimless.
"Yee sought and violated the public's trust," Levinson said. "This tarnishes not only himself but the government institution in which he served."
Yee was charged in 2014, a year when three other legislators and a former lawmaker also faced prosecutions. The criminal investigations cost Democrats their supermajority in the Legislature and prompted some reforms.
The Senate adopted resolutions that year to ban members from fundraising during the last month of the legislative session and the month leading up to a budget vote, when special interests are especially active in trying to influence legislation.
The resolutions also required the Senate Rules Committee to appoint an ethics ombudsman to accept allegations of wrongdoing and protect whistle-blowers from retaliation.
Looking back on those changes, Sen. Joel Anderson (R-San Diego) described them Wednesday as mere "window dressing for a culture of corruption."
"Sadly, all of the Senate reforms would not have prevented today's verdict," Anderson said.
Sen. Patricia Bates (R-Laguna Niguel) introduced a bill Friday aimed at closing a loophole in campaign finance law that Yee exploited. Her measure would extend contribution limits that apply to candidates' campaigns to also apply to ballot measure committees formed by elected officials.
"Today's sentencing of a former elected official underscores the need to close campaign finance loopholes wherever they exist," Bates said.
Gov. Jerry Brown, Senate leader Kevin de León and many other top Democrats declined to comment on the sentencing, which ends a case that has been an embarrassment to party officials. De León recently said Yee's guilty plea "turns the page on one of the darker chapters of the Senate's history."
Assemblywoman Cristina Garcia (D-Bell Gardens), a leading legislative proponent of tougher anti-corruption laws, welcomed Yee's sentence.
"The justice system has spoken and I'm glad today's sentence of Sen. Yee reinforces the basic principle that nobody is above the law," Garcia said. "His crime will do lasting damage, well beyond his five-year sentence, to the public's trust in their elected officials and their government."
Yee has 30 days before he must report for prison. In addition to his sentence, he was ordered to pay a $20,000 fine.
Dolan reported from San Francisco and McGreevy from Sacramento.