A special election was held for Mayor of the City and County of San Francisco on June 5, 2018, to fill the remainder of the term of Ed Lee, who had died in office on December 12, 2017. Upon Lee's death, London Breed, President of the San Francisco Board of Supervisors, became Acting Mayor of San Francisco, but a vote of six supervisors replaced Breed with Supervisor Mark Farrell. The mayoral election was held concurrently with the statewide direct primary election. In San Francisco, the election for the eighth district member of the board of supervisors was also on the ballot.
Eight candidates qualified to appear on the ballot and a ninth qualified as a write-in. The four major candidates were former Supervisor Angela Alioto, former Acting Mayor London Breed, Supervisor Jane Kim and former state senator Mark Leno. All four main candidates identified as Democrats, though the position is officially nonpartisan per the Constitution of California. The election was won by Breed, with Leno conceding the election on June 13. All local elections in California are nonpartisan.
Background.
Ed Lee, who was appointed Mayor of San Francisco in 2011 following Gavin Newsom's election as Lieutenant Governor of California, elected to a full term in 2011, and reelected in 2015, died of cardiac arrest on December 12, 2017. London Breed, the president of the San Francisco Board of Supervisors, became the city's acting mayor.
On January 23, 2018, the board of supervisors selected Mark Farrell to serve as interim mayor until the special election could be held. Citing Ron Conway's role as a benefactor to Breed, Supervisors Aaron Peskin and Jane Kim, considered the progressive members of the board, sought to deny Breed the benefits of incumbency going into the election.
As San Francisco elections use ranked choice voting, Kim and Mark Leno chose to align with each other, each endorsing the other as their preferred second choice.
Candidates.
The filing deadline was 5 p.m. on January 9, 2018.
Qualified.
The following eight candidates qualified for the ballot by filing all nomination documents and paying the filing fee. The deadline for a candidate to drop out of the race and remove himself or herself from the ballot was January 30, 2018.
General election.
Endorsements.
 ;templatestyles src="Endorsements box/styles.css"/ ;Angela Alioto
Organizations
 ;templatestyles src="Endorsements box/styles.css"/ ;Richie Greenberg
Organizations
 ;templatestyles src="Endorsements box/styles.css"/ ;Jane Kim
Organizations
Politicians
 ;templatestyles src="Endorsements box/styles.css"/ ;Mark Leno
Organizations
Politicians
 ;templatestyles src="Endorsements box/styles.css"/ ;London Breed
Organizations
Politicians
Results.
First-place votes counted on election night had Breed leading with 35.6 percent, Leno in second with 25.9 percent, and Kim with 22.8 percent. As candidates began to be eliminated, Leno took the lead the next day. He maintained a small lead during the week. On June 9, Breed took the lead over Leno. On June 13, with only 8,000 ballots left to count, Leno conceded defeat and congratulated Breed on her victory.
Results summary.
The following table shows a summary of the instant runoff for the election. The table shows the round in which the candidate was defeated or elected the winner, the votes for the candidate in that round, and what share those votes were of all votes counting for any candidate in that round. There is also a bar graph showing those votes for each candidate and categorized as either first-round votes or votes that were transferred from another candidate.
Continuing votes are votes that counted for a candidate in that round. Exhausted ballots represent votes that could not be transferred because a less preferred candidate was not marked on the ballot. Voters were allowed to mark only three choices because of voting system limitations. Over votes are votes that could not be counted for a candidate because more than one candidate was marked for a choice that was ready to be counted. Under votes are ballots were left blank or that only marked a choice for a write-in candidate that had not qualified as a write-in candidate.
References.
 ;templatestyles src="Reflist/styles.css" / ;