An FBI agent carries a box of evidence out of the Ghee Kung Tong temple in San Francisco's Chinatown during a raid Wednesday.

Photo: Michael Short, The Chronicle

An FBI agent carries a box of evidence out of the Ghee Kung Tong...

Image 2 of 16

State Sen. Leland Yee pulls away in a car surrounded by media members after being released on a $500,000 bond March 26, 2014 outside of the Federal Courthouse in San Francisco, Calif. State Sen. Leland Yee was arrested on public corruption charges early Wednesday morning.

Raymond "Shrimp Boy" Chow appears in this courtroom sketch before U.S. Magistrate Judge Nathanael Cousins in San Francisco March 26, 2014. Chow, previously convicted in a San Francisco organized crime probe was arrested with several others including California state Senator Leland Yee on Wednesday as federal investigators conducted public corruption raids across California, shaking up the election season in the nation's most populous state.

Photo: VICKI BEHRINGER, Reuters

Raymond "Shrimp Boy" Chow appears in this courtroom sketch before...

Image 4 of 16

Leland Yee, left, talks with Raymond "Shrimp Boy" Chow during a rally for a candidate for the city Board of Supervisors in 2010.

Raymond "Shrimp Boy'' Chow shows the certificate that was arranged by city Supervisor Fiona Ma.

Photo: Special To The Chronicle, SFC

Raymond "Shrimp Boy'' Chow shows the certificate that was arranged...

Image 7 of 16

A 1997 file photo of former San Francisco school board president Keith Jackson.

Photo: Courtesy, Lowell High School

A 1997 file photo of former San Francisco school board president...

Image 8 of 16

An FBI agent carries boxes of evidence out of the Ghee Kung Tong Chinese Free Masons Temple in Chinatown during a raid related to Sen. Leland Yee's arrest, San Francisco, CA, Wednesday Mar. 26, 2014.
The FBI raids State Sen. Leland Yee's office in Sacramento and other locations were searched by the FBI in San Francisco. He was reportedly arrested on public corruption charges Wednesday morning amid raids of his office in Sacramento and searches by the FBI in San Francisco.

Photo: Michael Short, The Chronicle

An FBI agent carries boxes of evidence out of the Ghee Kung Tong...

Image 9 of 16

SFPD and FBI agents stand outside the Ghee Kung Tong Chinese Free Masons Temple in Chinatown that was the target of a raid related to Sen. Leland Yee's arrest, San Francisco, CA, Wednesday Mar. 26, 2014.The FBI raids State Sen. Leland Yee's office in Sacramento and other locations were searched by the FBI in San Francisco. He was reportedly arrested on public corruption charges Wednesday morning amid raids of his office in Sacramento and searches by the FBI in San Francisco.

Photo: Michael Short, The Chronicle

SFPD and FBI agents stand outside the Ghee Kung Tong Chinese Free...

Image 10 of 16

FBI investigators load computers and other evidence from the house of state Sen. Leland Yee (D-San Francisco) in San Francisco on Wednesday, March 26, 2014. Yee has been arraigned in federal court on charges of public corruption.

Photo: Mathew Sumner, Special To The Chronicle

FBI investigators load computers and other evidence from the house...

Image 11 of 16

A box of cell phones sit in a van collected as evidence by the FBI from the house of state Sen. Leland Yee (D-San Francisco) in San Francisco on Wednesday, March 26, 2014. Yee has been arraigned in federal court on charges of public corruption.

Photo: Mathew Sumner, Special To The Chronicle

A box of cell phones sit in a van collected as evidence by the FBI...

Image 12 of 16

An FBI agent wheels boxes of evidence out of Senator Leland Yee's office at the State Capitol in Sacramento, California, March 26, 2014.

Photo: Max Whittaker/Prime, Special To The Chronicle

An FBI agent wheels boxes of evidence out of Senator Leland Yee's...

Image 13 of 16

California State Senator Leland Yee, PH.D (District 8, San Francisco) speaks during a press conference at the Far East Cafe regarding a bill that has been introduced by legislators to ban the possession, sale and distribution of shark fins used in a traditional Chinese soup on February 14, 2011 in San Francisco Calif.

Photo: David Paul Morris, Special To The Chronicle

California State Senator Leland Yee, PH.D (District 8, San...

Image 14 of 16

State Senator Leland Yee, D-San Francisco, right, and Sen. Kevin de Leon, D-Los Angeles, celebrate the passage of their gun control measures during the Senate session at the Capitol in Sacramento, Calif., Wednesday, May 29, 2013.

Senator Leland Yee- D of San Francisco,(right) and Senator Ron Calderon, of Montebello, in a discussion on the floor of the Senate Chamber at the State Capitol, in Sacramento, Ca., on Thursday May 3, 2012. When Californians go to the polls this year, first in next month's primary and then in the November election, they could do something that hasn't happened since the fallout from the Watergate scandal, give one party a supermajority in the Legislature.

Photo: Michael Macor, The Chronicle

Senator Leland Yee- D of San Francisco,(right) and Senator Ron...

Image 16 of 16

2011 mayoral candidate and state senator, Leland Yee, explains his platform to the editorial board of the San Francisco Chronicle in San Francisco, Calif. on Sept. 29, 2011.

A 137-page federal complaint lays out the charges against state Sen. Leland Yee, alleged Chinatown mobster Raymond "Shrimp Boy" Chow and 24 others connected to Chow. But it also reads like a Hollywood script.

There's the slick FBI agent going deeper undercover and pushing the action. There's the gangster with the catchy nickname who publicly claims to have gone straight. And there's the veteran politician, allegedly willing to compromise his values to stay in office.

The tale reached a climax Wednesday when the government unsealed charges against Chow, Yee and 24 others after a series of coordinated raids. Chow, 54, stands accused of money laundering and other crimes, while Yee, 65, faces charges that he traded political favors for campaign donations and, at one point, facilitated a gun-trafficking deal.

The complicated story - plotted in large part by the FBI - started with a meeting in a karaoke bar booth. At the outset, Yee wasn't even on investigators' radar.

Enter 'UCE 4599'

In May 2010, an undercover agent identified only as "UCE 4599" reported sitting down with Chow, the head of the Ghee Kung Tong brotherhood in Chinatown, at a San Francisco karaoke bar.

The agent, who scored an introduction to his prime target through an undercover colleague, portrayed himself as a member of La Cosa Nostra. Over time, the FBI said, he gained Chow's trust - enough to be sworn into his organization as a "consultant."

Chow leaned in, the federal complaint says, to whisper a secret: Although he went clean after his 2003 release from prison, he approved all criminal activity in his organization.

This marked a pattern, authorities said, with Chow refusing to be directly involved in money laundering, gun trafficking and drug running but making introductions to facilitate deals before accepting envelopes stuffed with $1,000 or $2,000 in cash from the FBI agent.

In one recorded call, Chow allegedly said he "sacrificed himself by being the target of law enforcement and that has enabled other members of his organization to conduct criminal activity 'freely.' "

The next month, the FBI said, Chow traveled to Oahu to meet with UCE 4599 and another undercover agent. On a chartered boat, the three men purportedly discussed Chow's idea for an illegal scheme to ship "military grade" tungsten metal between the U.S. and China, and to export high-end cognacs.

The schemes didn't pan out. But soon, the FBI said, UCE 4599 provided members of Ghee Kung Tong with millions of dollars he claimed to have earned via drug and gun deals. Chow's associates laundered the money, according to the complaint, and took a 10 percent commission.

The case was moving along like a fairly ordinary gang takedown. But within months of Chow's first meeting with the agent, the FBI said, Chow began working with Keith Jackson, a former San Francisco school board member and public relations pro who was doing fundraising work for Yee.

Jackson, 49, approached Chow to seek support for the Hunters Point Shipyard development in the Bayview, a project for which Jackson consulted. According to the compliant, Chow introduced Jackson to the agent in August 2010, telling him that Jackson "can do 'inside deals' with the city."

The following May, the FBI said, Jackson began soliciting donations from the agent for Yee's mayoral campaign, saying he wanted him to give more than the city's $500 limit - while describing how much money Yee would control if elected mayor.

The agent reported that he refused but set Jackson up with another undercover agent. That agent cut a $5,000 check to Jackson's consultancy firm that was meant for the campaign and helped raise thousands of dollars more, according to the complaint.

After Yee lost the mayor's race, Jackson allegedly continued to ask the agents for donations. Yee was said to be desperate for money - saddled with $70,000 in campaign debt and looking for funds for his run for secretary of state.

From the start, according to the complaint, Jackson and Yee agreed that donations would be attached to favors. The scenarios, though, appear to have been fabricated by the FBI.

In exchange for $10,000, Yee allegedly lobbied a manager at the state Department of Public Health. For $21,000, the FBI said, the senator agreed to arrange meetings with two senators. And for $6,800, Yee honored Ghee Kung Tong with an official proclamation.

That same month, the original agent, UCE 4599, reported buying a handgun and ammunition from Jackson and his son, 28-year-old Brandon Jackson. The next month, the agent allegedly bought nine guns and two ballistic vests from the Jacksons. One of the vests had been stolen from the FBI.

The arms dealer

In August 2013, the complaint alleges, conversations between Keith Jackson and the FBI agent broadened.

Jackson allegedly offered to introduce the agent to an international arms dealer whom Yee knew in exchange for more money for the secretary of state campaign.

Jackson, his son and another man also agreed to kill someone for the agent for a fee of $10,000 to $25,000, the FBI said. This, too, was a fabrication: Another undercover agent later posed as the supposed victim, and the killing never happened.

At an October meeting, the FBI said, Jackson told the agent that he needed to talk to "Uncle Leland" about brokering a meeting with an arms trafficker who "was attempting to ship weapons to the Philippines because there was an ongoing war between an unidentified Philippine Muslim group and the Philippine government."

Two months later, the agent reported giving Jackson $1,000 for Yee's campaign as "motivation" to set up a meeting with the weapons trafficker.

At a meeting soon after, the FBI said, Yee told the agent that he had known the arms dealer for years and that it wasn't a business "for the faint of heart."

"Do I think we can make some money?" Yee asked, according to the complaint. "I think we can make some money. Do I think we can get the goods? I think we can get the goods."

At various times, the FBI said, the agent told Yee he wanted "shoulder-fired weapons or missiles," or "Hellfire missiles," and said he was ready to spend up to $2.5 million.

The senator allegedly agreed, telling the agent he saw their relationship as beneficial, and promising he could help him in future business deals as secretary of state.

Despondent, paranoid

The complaint portrays Yee, a 26-year public servant who has a wife and four grown children, as despondent with life and paranoid about getting cut out of the arms deal - but also fearful of getting caught.

The senator, the FBI said, alluded to the corruption indictment of another state senator and at one point said he wanted to hide out in the Philippines.

"There is a part of me that wants to be like you," the complaint quotes Yee as telling the undercover agent. "You know how I'm going to be like you? Just be a free agent out there."

At a series of San Francisco meetings this month, the FBI said, Yee met with Keith Jackson and the undercover agent, asking for more campaign money and discussing how weapons from the Philippines would get to buyers in North Africa.

Yee, an outspoken advocate of gun control, purportedly said it would be easier if the agent could get weapons directly from the Philippines, instead of shipping them through New Jersey. Yee allegedly said he had access to automatic weapons - but wasn't sure about shoulder-fired missiles.

Yee told the agent that Africa "was a largely untapped market for trade," the FBI said. But according to the complaint, Yee said he couldn't travel to the Philippines until November, when the election would be over, and that he needed to be there to facilitate the deal.

On Thursday, a day after federal and local authorities stormed his Sunset District home, Yee bowed out of the race for secretary of state.

It's still not clear whether there was ever an international arms dealer - or if Yee, like the agents who took him down, had made the whole thing up.