The ranked-choice voting results, released Tuesday afternoon by the Department of Elections, showed Mark Farrell leading Janet Reilly in District 2 by 270 votes, 50.62 percent to 49.38 percent.
Reilly led in first-choice votes by 184, but San Francisco's ranked-choice system factors in voters' second and third choices.
Farrell's campaign released a statement Tuesday declaring victory.
"While it was a long campaign and ultimately a close election, I am both honored and excited to represent the residents of District 2, and look forward to working to return common sense, fiscal discipline and neighborhood leadership back to City Hall," Farrell said.
He will replace Supervisor Michela Alioto-Pier, who is termed out.
Reilly was not immediately available for comment.
Tuesday's results also showed Malia Cohen leading Tony Kelly by 412 votes in District 10, although Kelly received 34 more first-choice votes.
Kelly conceded Tuesday, saying in a statement that he had congratulated Cohen for her win and was "very proud of the grassroots campaign that we built over the past year."
Cohen, who was not immediately available for comment, will replace termed-out Supervisor Sophie Maxwell in that district.
Districts 2 and 10 were the closest races.
"For 2 and 10 we've pretty much processed every card for that contest," Elections Department Director John Arnst said today. He said the spreads remained "pretty big."
In District 6, Jane Kim retained a 54.2 percent to 45.8 percent lead over Debra Walker, and will replace Supervisor Chris Daly.
In District 8, Scott Weiner led Rafael Mandelman 55.8 percent to 44.2 percent. He will replace Supervisor Bevan Dufty, who is running for mayor.
Though final official elections results have not yet been certified, Arnst said the leaders in the four races would likely be the winners.
"If the tally continues as it has to this point, with the number of cards remaining, it would seem unlikely that the results would change," he said.
Supervisor Carmen Chu won re-election after running unopposed in District 4.