Ed Lee claimed victory Wednesday as San Francisco's first elected Chinese American mayor, finishing ahead of Supervisor John Avalos, the progressive standard bearer, and City Attorney Dennis Herrera when the ranked-choice votes were tallied.
Appointed District Attorney George Gascón won a full four-year term in office, while Supervisor Ross Mirkarimi is on his way to becoming San Francisco's new sheriff.
While the preliminary ranked-choice count is unofficial, the results have typically held up in the past. About 32,000 late-arriving ballots remain to be counted, said John Arntz, the city's election director. He said he expects final results in 10 days to two weeks.
But the candidates aren't waiting for the final figures.
Lee told reporters outside the mayor's office that while he avoided using the term "victory" Tuesday night out of respect for ranked-choice voting, "this latest report shows that the voters of San Francisco want four more years of what we have been doing."
Flanked by his wife and one of his daughters, Lee pledged to bring more jobs to the city and pull the city together.
"Every neighborhood is going to know that this mayor represents them," he said.
Lee, a bureaucrat and political novice when he was appointed to the mayor's job in January, finished with 61 percent of the vote after the second- and third-place ranked-choice votes were counted, well ahead of the 38 percent for Avalos.
Avalos, however, isn't ready to concede, despite being more than 25,000 votes behind Lee at the end of the ranked-choice count.
"There are still votes to be counted," said Erica Fox, a spokeswoman for the Avalos campaign.
But other challengers congratulated Lee, including Herrera, who in a statement called Lee's win a "well-earned victory."
Supervisor David Chiu, the fourth-place finisher, called Lee on Wednesday afternoon and promised to keep working with him.
"I have said all along that while we were competitors on the campaign trail, we have remained colleagues at City Hall," Chiu said.
"Now it's back to work," he added.
While the uncounted ballots are expected to boost the voter turnout to around 40 or 41 percent, that's nowhere near the 50 percent average of the past 10 mayoral contests.
Lee's early and continuing lead in the polls sucked all the excitement out of the race, said David Latterman, a political analyst and lecturer at the University of San Francisco.
"This was not (Gavin) Newsom versus (Matt) Gonzalez" in the 2003 mayor's race, he said. "This was Ed Lee against the field, and Ed and the field weren't that interesting."
Still, the two down-ballot races for district attorney and sheriff were overshadowed - in attention and money - by the battle for mayor. But the two citywide offices carry a lot of political clout and were fiercely contested.
Gascón is a newcomer to elections, but his last job as San Francisco police chief made him no stranger to politics. He was appointed district attorney 11 months ago by then-Mayor Newsom to fill out the remainder of Kamala Harris' term when she became state attorney general.
It took Gascón until round three of the vote tabulation to pass the 50 percent mark and bypass his top challengers: David Onek, a former city police commissioner and senior fellow at the University of California-affiliated Berkeley Center for Criminal Justice; and Sharmin Bock, an Alameda County prosecutor. Gascón had 63 percent at the end of the ranked-choice count.
The apparent winner declined to make a statement Wednesday. But Onek, running second, and Bock, who placed third, both called Gascón on Wednesday to offer congratulations.
In the race to replace longtime Sheriff Michael Hennessey, who is retiring after eight terms in office, Mirkarimi would not declare victory, but said he was "cautiously optimistic" that he would come out on top once the final ballots are counted. It took three rounds for him to finish first, with 53 percent, after Wednesday's tally.
His two chief challengers - Paul Miyamoto, a 15-year veteran of the Sheriff's Department, and Chris Cunnie, the politically connected former head of the powerful Police Officers Association - would not concede defeat Wednesday. Miyamoto came in second and Cunnie third.
If Mirkarimi's lead holds, he will have handed San Francisco progressives a big win. It also would present a big opportunity for the more politically moderate Lee, who would get to name Mirkarimi's replacement for the year remaining on his Board of Supervisors' term.
The District Five supervisor represents the Haight, Western Addition, Hayes Valley and adjacent neighborhoods and has been a solid left vote since the return of district elections in 2000.
E-mail John Wildermuth and Rachel Gordon at jwildermuth@sfchronicle.com and rgordon@sfchronicle.com. Chronicle staff writer Stephanie Lee contributed to this report.