SAN FRANCISCO — Flanked by some of his alleged criminal confederates, suspended state Sen. Leland Yee pleaded not guilty Tuesday to federal gun trafficking and political corruption charges — the first step in what promises to be a drawn-out legal drama to determine whether he will spend the rest of his life in prison.

During a brief appearance in federal court here, the 65-year-old Yee, through his lawyer, entered the plea to an indictment that accuses him of accepting bribes in exchange for political favors and trying to arrange an international arms deal with an undercover FBI agent.

With his wife Maxine by his side, Yee posted his Sunset District home as bond to remain free while the case against him unfolds. He is scheduled to appear again in court on Friday before U.S. District Judge Charles Breyer, who has been randomly assigned to hear the case against the embattled legislator and dozens of co-defendants.

Yee, dressed in a dark suit, declined to speak to reporters outside court and his lawyer, James Lassart, also declined to comment.

He awaited his arraignment sitting next to Wilson Lim, the Peninsula dentist who is alleged to have been involved in the gun trafficking allegations, and a few feet from Keith Jackson, a San Francisco political consultant portrayed in the indictment as the state senator’s chief conduit to corruption.

Lim and Jackson also pleaded not guilty Tuesday.

Federal prosecutors allege Yee accepted checks and bags of cash from undercover operatives to pay off his campaign debts and help fund his now-derailed bid to become secretary of state. Yee also is alleged to have tried to orchestrate an international arms deal with an undercover agent, promising to arrange shipments of high-powered weaponry from rebel groups in the Philippines for money.

The indictment is based largely on a three-year undercover FBI investigation in which Yee was allegedly involved in cutting illegal deals with agents posing as everything from East Coast mafia members to an Arizona businessman looking to expand into the medical marijuana business in California. An FBI affidavit alleges that Yee was involved in such clandestine illegal meetings as recently as mid-March, as he was ramping up his run for statewide office.

The San Francisco Democrat is specifically charged with gun trafficking and conspiracy to commit honest services fraud, a linchpin of many federal corruption cases. Paul De Meester, Yee’s previous lawyer, suggested after his arrest that he would explore whether the lawmaker had been entrapped by the FBI, considered a likely defense by legal experts following the case.

The Yee indictment unfolded as a result of a probe into Raymond “Shrimp Boy” Chow, a reputed leader of an Asian organized crime syndicate and a longtime target of federal law enforcement officials who is now charged with a string of felonies, from conspiracy to money laundering. Famed San Francisco lawyer J. Tony Serra has agreed to represent Chow, who did not enter a plea on Tuesday.

Outside court, Serra, renowned for his theatrical attacks on the government, vowed to take Chow’s case to a jury, calling him innocent and maintaining the investigation is rife with “outrageous government misconduct” and racial profiling of the San Francisco Asian community.

“The government created the crime, the government financed the crime,” Serra said. “We will put the government, rightfully, on trial. … It’s the best anti-government case I’ve seen in maybe a decade.”

Staff writer Josh Richman contributed to this story. Howard Mintz covers legal affairs. Contact him at 408-286-0236 or follow him at Twitter.com/hmintz.