It is hard to imagine San Francisco without Nancy Pelosi as its representative on Capitol Hill, but the city’s voters for the first time since 1987 had a wide-open congressional race and could debate who should succeed her.
And debate it, they did. The campaign was marked by contentious candidate forums, nasty attack ads and big spending by tech titans. On Tuesday, State Sen. Scott Wiener, a prolific legislator in Sacramento, was the first to advance to the general election, according to The Associated Press.
He is known for pushing legislation to allow for the development of more housing and to protect gay and transgender rights. Before he was in the State Legislature, he served on the San Francisco Board of Supervisors, akin to a city council.
He is considered a moderate Democrat in liberal San Francisco, but is regularly blasted as a member of the “radical left” by Fox News and other conservative outlets, particularly for his work on transgender issues and his legislation to ban ICE agents from wearing face masks.
Also on the ballot in Tuesday’s primary was Connie Chan, a member of the Board of Supervisors who represents the Richmond district, and Saikat Chakrabarti, a tech entrepreneur who briefly worked as the chief of staff for Representative Alexandria Ocasio-Cortez.
Ms. Chan and Mr. Chakrabarti, both Democrats, are competing for the second spot in the November general election, now that Mr. Wiener has advanced.

Ms. Chan received a boost late in the primary race when Ms. Pelosi endorsed her. Both women have close ties to the city’s powerful labor unions and have stressed the importance of improving affordability for working families.
He did win the endorsements of two other members of the so-called Squad, Representatives Ilhan Omar and Rashida Tlaib. He said that mainstream Democrats were proving a poor match for the Trump administration, and revolutionary leaders with fresh ideas were needed.
Mr. Chakrabarti is worth hundreds of millions of dollars from his early employment at Stripe, a payments processing platform, and spent more than $8.8 million of his own money on his race. He and Ms. Chan split the progressive vote.
The campaign drew big outside spending. Mr. Wiener received the most from individual donors, $4 million, many of whom gave the maximum of $7,000 apiece. Mr. Chakrabarti had more donors, but they gave smaller amounts. Ms. Chan struggled to keep pace with both of them in terms of donations.
Tech titans also spent big on the race, largely supporting Mr. Wiener. He received donations from the cryptocurrency billionaire Chris Larsen and from Sam Altman, the chief executive of OpenAI. A political action committee backing Mr. Wiener was funded by Mr. Larsen and Garry Tan, a wealthy tech investor. In mailers, they painted Mr. Chakrabarti as a carpetbagger with few real ties to San Francisco.
Ms. Pelosi, who served for 39 years and became one of the most powerful women in American political history, campaigned hard for Ms. Chan in the final days of the primary campaign. She attended a rally at Joe DiMaggio Playground on Friday in support of Ms. Chan, and the two women were joined by former Mayor Willie Brown.
On Saturday, the women were at a union hall heaping praise on one another.
“For the last four decades, together, we elected Speaker Madam Nancy Pelosi,” Ms. Chan told the crowd. “She is our accomplishment.”

