She had also begun to draw the support of more Democratic establishment figures, including both of the state’s U.S. senators — Chuck Schumer and Kirsten Gillibrand — who could face challengers from the left in future election cycles.
Still, Ms. Walton was not uniformly embraced by state party leadership, as Gov. Kathy Hochul — a Buffalo native — and Jay S. Jacobs, the chairman of the New York State Democratic Committee, declined to endorse her.
In the closing weeks of the campaign, Mr. Jacobs had come under particular fire after suggesting Ms. Walton’s win in the primary was akin to an infamous white supremacist, David Duke, winning his party’s nomination. (Mr. Jacobs, who heard calls for his resignation, later apologized.)
Ms. Walton, 39, was tying to become the first woman and first Black woman to lead New York’s second largest city, as well as the first socialist to lead a major American city in decades. A first-time candidate, she has an evocative life story as a single mother and labor organizer — a narrative that she leaned on in advertisements, some of which were paid for by groups like the Working Families Party, a labor-backed organization that often supports progressive candidates.
She had run an energetic primary campaign, surprising Mr. Brown, who largely refused to acknowledge her candidacy, having won past campaigns comfortably in a city in which Democrats far outnumber Republicans.
The mayor’s blasé attitude changed radically, however, after Ms. Walton’s win, as he announced his write-in campaign and attempted a legal push to get himself put on the ballot. That effort failed after a pair of judges ruled against Mr. Brown in September, leaving Ms. Walton the only candidate whose name was on the ballot.
As the campaign continued, political observers here repeatedly suggested that Mr. Brown could be a favorite, if only because of his 16 years in office and widespread name recognition.