The U.S. has never elected a president whose resumé topped out at mayor — let alone mayor of the 305th most populous city in the country.

But Pete Buttigieg has shattered plenty of expectations in his once long-shot presidential bid, outlasting governors and senators and finishing atop this week’s Iowa caucuses in a photo finish with Sen. Bernie Sanders.

Now the 38-year-old former mayor of South Bend, Indiana, is facing escalating attacks from critics who argue he’s unprepared for the White House and too inexperienced to take on President Trump. After all, at 103,869 people, South Bend is slightly smaller than San Mateo and Inglewood and just a bit larger than Vacaville and Burbank, according to 2018 Census Bureau estimates.

So does leading a city of roughly 100,000 prepare someone to take over the Oval Office? In Buttigieg’s case, California mayors of South Bend-size cities say yes.

“It certainly raises the question of, maybe I could be president,” said Jesse Arreguín, the 35-year-old mayor of Berkeley — which, as he pointed out, is home to about 18,000 more people than South Bend. “His experience as a mayor has made him a really attractive candidate, in that he has the practical, on-the-ground experience of dealing with local issues and solving problems.”

While Arreguín said Buttigieg was “uniquely qualified” for the nation’s top job due to his military experience serving in Afghanistan, he argued that “if Mayor Pete can do it, any mayor can do it.”

In interviews this week, mayors of more than a half-dozen cities around California said they’ve been inspired by the rise of “Mayor Pete” from an unknown city leader with a hard-to-pronounce last name to a top presidential contender.

The job of a small-city mayor is one of the less glamorous roles in American politics. Officeholders are more likely to have to deal with overloaded sewer systems or preside over late-night debates about zoning policy than headline a massive rally or get an invitation to talk national security on CNN.

But at a time when trust in Washington is at an all-time nadir, mayors often have a more direct connection to their constituents than senators or representatives.

As the mayor of a small or midsize city, “you cannot escape the voters,” said Katrina Foley, the mayor of the Orange County city of Costa Mesa, population 113,610. “Whether they see you in a coffee shop or the grocery store or your favorite restaurant, they’re not afraid to tell you if they love you or they’re unhappy with you. You get a really grounded sense of what the electorate wants.”

Buttigieg, who relinquished the mayor’s job at the end of December, played a more active role in his city than most California mayors. The northern Indiana city has a “strong mayor” system of government, which means the mayor is the city’s chief executive and has administrative authority over the government.

Most small and midsize California cities have a “council-manager” government, with a mayor and city council making policy decisions and a hired city manager running day-to-day operations. Some smaller cities rotate the role of mayor among the city council members every year, instead of electing their mayor directly.

Many California mayors have been surprised, and some thrilled, by Buttigieg’s success in the White House race. Foley was in the middle of a five-hour-long city council debate over the placement of cell phone towers on Tuesday night — “a very weighty discussion,” she said — when a colleague showed her the news that Buttigieg was in first place in Iowa.

While Foley said she thinks Buttigieg is qualified, she said she agreed with comments by Sen. Amy Klobuchar and other observers that a woman with his resumé would be far less likely to be considered a viable presidential contender.

Foley herself is running for state senate this year, although her husband has jokingly suggested she consider the White House instead. But “I haven’t been in the military, I don’t have that international experience, I don’t speak five languages or whatever,” Foley pointed out. (Buttigieg’s campaign has said he actually speaks eight languages, with varying levels of proficiency: English, Norwegian, Spanish, French, Italian, Maltese, Arabic, and Dari.)

Most of the California mayors interviewed haven’t decided who they’ll vote for in next month’s presidential primary — and none has started planning their own White House bids four or eight years down the road. But Buttigieg’s ascent has provoked plenty of similar jests and jibes for the city hall denizens.

“It’s a common joke among my friends: Why aren’t you running for president?” said Matt LaVere, the 41-year-old mayor of Ventura, population 111,120, who said he’s focused on building up his city’s tax base and improving infrastructure.

“I’ll admit I don’t feel like I’m ready to be president, but I don’t think that should apply across the board to mayors of similar-size cities,” LaVere said. “Pete’s proven he’s qualified. He’s made it this far.”

As mayor, Buttigieg helped reboot the economy of his struggling rust belt city, turning abandoned factories into tech work spaces and revitalizing the city’s downtown. Under his watch, unemployment fell, new investments came into the city, and South Bend recorded its first significant population increase in decades. And he made advances on more mundane topics as well, such as upgrading the city’s sewer system to reduce overflows.

That focus on unsexy details is familiar to his California colleagues. The job of a small-city mayor is “not just filling potholes — but it’s not not filling potholes,” said Joe Goethals, the mayor of San Mateo, population 105,016.

Goethals said he’s focused on building a state-of-the-art new wastewater treatment plant and upgrading the city’s levees to deal with seawater rise — not the type of challenges that get much airtime in a presidential debate, but decisions that will likely impact his city’s future more directly than anything dreamed up in Washington, D.C.

“Mayors are uniquely qualified to get things done,” he argued, saying voters prefer presidential candidates like Buttigieg who are D.C. outsiders.

Buttigieg also attracted controversy with moves like demolishing vacant homes. And he’s faced considerable scrutiny over his handling of South Bend’s police department — including his decision to fire the city’s first African-American police chief — which escalated after a white officer fatally shot a black man last summer. That record has dogged his campaign as he’s struggled to raise his dismal poll numbers among African-American voters.

Of course, he’s not the only mayor in the race — there’s also former New York City Mayor Michael Bloomberg, who’s staked his campaign on his record running a city that’s about 80 times as populous as South Bend. Bloomberg has racked up endorsements from more than a dozen mayors across California.

Arreguín, who is supporting Buttigieg’s rival Sanders (another former mayor, of Burlington, Vermont), said that the experience of running a college town — like both Berkeley and South Bend, the home of Notre Dame University — is an especially rigorous training ground for building consensus over challenging issues.

Still, he argued that “running Berkeley is probably more challenging than running South Bend,” citing the East Bay city’s levels of homelessness, housing costs and inequality.

Most of Buttigieg’s top rivals are current or former U.S. senators, and he’s drawn contrasts with them by stressing his executive experience. Tom Butt, who’s served as the mayor of Richmond since 2015, said Buttigieg and Bloomberg stand out from most of the other presidential contenders.

“There’s a huge difference between legislating something and actually making it happen on the ground,” said Butt, who was surprised to learn that his city of 110,175 people is larger than Buttigieg’s. “It’s like night and day.”

Even small cities can help bring about changes in policy that extend far beyond their borders, Butt said. In recent years, Richmond became one of the first cities in the country to pass bans on plastic bags and vaping products, two movements that were later adopted in many other cities around the state and the nation.

“So much cutting-edge public policy starts in the cities, and mayors are a big part of that,” Butt said. “While the federal government is going the wrong direction, mayors are leading the way.”