“Hearts are broken,” he said of his hometown. “My heart is broken.”

Mr. Buttigieg was headed to South Florida on Monday for fund-raising events before this week’s debate in Miami.

By instinct and by training, Mr. Buttigieg, the son of two Notre Dame professors, is a technocrat, one in whom political ambition has burned since he was a schoolboy. Working as a McKinsey consultant after graduating from Oxford, where he was a Rhodes scholar, he was trained in performance management. When he first explored running for mayor at 28, he wowed many South Bend power brokers with his grasp of policy detail in a report called “Benchmarking South Bend” that predicted economic decline.

He came into office versed in data and analysis, and as a closeted gay man who kept his sexuality secret from the public for his first four years in office.

In his fourth month on the job, he fired South Bend’s first black police chief, the root of some African-American residents’ distrust of him, and a decision he admitted later was made on dryly legalistic grounds, without concern for the human fallout.

But over two terms, Mr. Buttigieg has evolved into a more feeling leader, both allies and opponents of his said, even if he has never become a feel-your-pain politician like President Bill Clinton. His affect is sometimes compared to the professorial detachment of Mr. Obama, which in the end became a liability for even some of his supporters.

Still, Mr. Buttigieg has shown the potential to inhabit the role of consoler in chief after tragedies. When a gunman massacred Muslim worshipers in New Zealand this year, the mayor wrote in an open letter to Muslims in South Bend, “I want you to know that this entire city has its arms around you.”