After more than a week of counting votes and months of a tense campaign centered on crime and homelessness, San Jose has a new mayor.

Matt Mahan, the rookie city councilman backed by the incumbent mayor, declared victory on Wednesday after his challenger and longtime labor-backed South Bay politician Cindy Chavez called to concede the tight race.

“The count as of today now shows our campaign for common sense will win a majority of the votes,” Mahan said. “This has been a long and hard-fought campaign. But what unites us as a city is much more powerful than any divisions from a political contest.”

The battle for San Jose mayor was one of three high-profile Santa Clara County races that remained close more than a week after the election. In the Santa Clara County sheriff’s race, Bob Jonsen led Kevin Jensen by just under 1.5 percentage points. And in the Santa Clara mayor race, Anthony Becker conceded to Mayor Lisa Gillmor on Wednesday afternoon.In San Jose, Mahan will become the city’s first new mayor in eight years, replacing Mayor Sam Liccardo, who joined the city’s business and real estate interests in endorsing Mahan. He takes the helm at a pivotal time for the 10th largest city in America as Google moves forward with a major campus and housing project downtown and BART is scheduled to make its long-planned push into the core of the city.

Chavez, a Santa Clara County supervisor and San Jose’s former vice mayor, was considered a favorite at the start of the campaign but had been fighting an uphill battle since the first ballots were counted Nov. 8. A week later, with about 90% of expected ballots counted, Chavez had fallen further behind. She was down by 6,351 votes with Mahan leading 51.32% to Chavez’s 48.68%, when she decided to concede.

In her concession statement, Chavez said she called Mahan “to wish him the best of luck in his two-year term as mayor,” referring to a measure voters passed in June to align the city’s mayoral election with presidential elections, and perhaps hinting at a Mahan-Chavez rematch in 2024.

“San Jose faces numerous challenges in the months and years ahead,” Chavez said in a statement, “requiring that we all work collaboratively with the entire City Council to reach meaningful and equitable solutions.”

Mahan in response congratulated Chavez “on her strong campaign” and said he hopes “to work with her closely in the years ahead to address the challenges facing San Jose.”

The defeat marks Chavez’s second loss in a bid for San Jose mayor. She ran in 2006 when she was serving as vice mayor, losing overwhelmingly to Chuck Reed, a sharp critic of then-mayor Ron Gonzales, who was caught up in a scandal over a trash hauling contract at the time. Gonzales’ woes were widely seen as a drag on Chavez’s campaign that year.

This year’s race was much closer, and Chavez seemed to have the advantages in experience, name recognition and money. Though Mahan had the edge in personal campaign funds, for which donors are limited to $1,400 each per election, Chavez had more funding from independent political committees representing labor and business interests. Combined with her own campaign funds, she had $5 million behind her effort to Mahan’s $3 million.

“At first blush, one would have expected her to do very well between her name recognition and experience and financial advantage,” said Larry N. Gerston, political science professor emeritus at San Jose State University. “That’s a combination that usually proves to be successful.”

Mahan seems to have effectively cast his rival as the insider candidate responsible for rising homeless encampments and violent crime, even though, as Chavez would point out in frustration during the campaign, Mahan is the one who’s on the City Council now and backed by the outgoing mayor. Gerston said voters saw Chavez as the “de facto incumbent.”

“People wanted the city to have a fresh start,” Gerston said.

Turnout also may have hurt Chavez’s campaign — countywide turnout was listed at 52% as of Wednesday morning. Gerston said that typically means fewer liberal voters who would be expected to align with labor candidates like Chavez. That was one reason behind the city push to align its mayoral races with presidential races. Chavez didn’t rule out Wednesday taking another shot at the mayor race, saying “that is a decision that will be made with the input of my family and our community.”

But the official measure of turnout — the proportion of registered voters who voted — is misleading with today’s universal vote by mail in which every registered voter is mailed a ballot. Only 180,930 votes were cast in the hard-fought open mayoral race in 2014 in which Liccardo was elected, while more than 240,000 votes have been cast this year.

“While this has been the longest period of vote counting in recent memory, we need to remember that we have also just seen the highest number of votes cast for mayor in our city’s history,” Mahan said Wednesday.

The race focused on questions of who would best tackle rising violent crime and homelessness. Chavez, a former labor leader and San Jose councilwoman, ran on her experience in elected office, saying San Jose had 200 more officers when she last served, and that while at the county she’d helped improve sex assault case processing and led efforts to pass a $950 million affordable housing bond.

Mahan, the District 10 City Council member since 2020 and former social media entrepreneur and schoolteacher, said that homeless encampments have proliferated while Chavez focused on expensive and time-consuming long-term affordable housing projects. He said expenses approved when Chavez last served have limited police budgets, while her bail reforms at the county have have put too many criminals back out on the streets following arrests.

Mahan expressed hope he can work with Chavez and her supporters now toward his goals.

“We all want our city to be safe, to prosper,” he said, “and our mission in the years ahead is to work together for common-sense solutions to end street homelessness, fight crime more effectively, make our city more affordable, clean up San Jose and hold ourselves as elected officials accountable for results.”