An ex-California state senator pleaded guilty Wednesday to a racketeering charge in an organized crime and public corruption case centered in San Francisco's Chinatown.

Leland Yee could face a maximum sentence of 20 years in prison when he is sentenced in October after entering the plea to conspiracy to conduct and participate in affairs of an enterprise through a pattern of racketeering.

He appeared relaxed as he entered court in a dark suit and red tie, smiling and chatting with people in the audience.

The FBI arrested Yee and 19 others in 2014 during a series of raids, one of which targeted a Chinese fraternal organization. Yee was accused of soliciting and accepting bribes in exchange for providing help from Sacramento.

The FBI also alleged that the San Francisco Democrat, who was running for secretary of state at the time, conspired to connect an undercover agent with an international arms dealer in exchange for campaign contributions.

Yee previously pleaded not guilty to bribery, money laundering and other felony charges.

The arrests were the culmination of the FBI's multi-year investigation of Raymond "Shrimp Boy" Chow, the elected "dragonhead" of the Chinese fraternal group known as the Ghee Kung Tong.

The FBI alleges the association was a racketeering enterprise and that undercover agents laundered $2.6 million in cash from illegal bookmaking through the organization.

Chow has pleaded not guilty to money laundering and other charges.

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.

Jackson, along with Yee, was accused of soliciting bribes in exchange for helping a business and influencing legislation.

Jackson pleaded guilty to the same racketeering charge as Yee on Wednesday.

Yee also discussed helping an undercover FBI agent get weapons worth $500,000 to $2.5 million, including shoulder-fired missiles, and explaining the entire process of acquiring them from a Muslim separatist group in the Philippines to bringing them to the U.S., according to an FBI affidavit.

Yee said he was unhappy with his life and told the agent he wanted to hide out in the Philippines, the FBI affidavit says.

The agent who discussed arms with Yee allegedly presented himself as a member of Ghee Kung Tong.