NEW YORK — Eric Adams, a former New York City police captain whose attention-grabbing persona and keen focus on racial justice fueled a decadeslong career in public life, was elected on Tuesday as the 110th mayor of New York and the second Black mayor in the city’s history.

Mr. Adams, who will take office on Jan. 1, faces a staggering set of challenges as the nation’s largest city grapples with the enduring consequences of the pandemic, including a precarious and unequal economic recovery and continuing concerns about crime and the quality of city life, all shaped by stark political divisions over how New York should move forward.

Mr. Adams’ victory signals the start of a more center-left Democratic leadership that, he has promised, will reflect the needs of the working- and middle-class voters of color who delivered him the party’s nomination and were vital to his general election coalition.

Yet there are also signs that the officials Mr. Adams must work with closely — prominent City Council members, the public advocate and other newly elected Democrats, including the Manhattan district attorney and city comptroller — may be substantially to Mr. Adams’ left.

Advertise with us

Mr. Adams’ victory over his Republican opponent, Curtis Sliwa, was resounding, encompassing wealthy Manhattan enclaves that once tilted Republican as well as struggling parts of the city, diverse immigrant communities and neighborhoods long associated with Black political power.

He will begin the job with significant political leverage: He was embraced by both Mayor Bill de Blasio, who sought to chart more of a left-wing course for New York, and by centrist leaders like Michael Bloomberg, Mr. de Blasio’s predecessor. Mr. Adams was the favored candidate of labor unions and wealthy donors. And he and Gov. Kathy Hochul have made clear that they intend to have a more productive relationship than Mr. de Blasio had with Andrew Cuomo when he was governor.

The Associated Press called Mr. Adams’ victory 10 minutes after polls closed, reflecting the overwhelming edge Democrats have in New York City even amid signs of low turnout.

In New York City, the difficulties that Mr. Adams will encounter were apparent even as he celebrated his victory.

In one of the world’s financial capitals, workers are barely trickling back to their midtown Manhattan offices. The tourism industry is suffering. Many of the city’s beloved restaurants and other businesses have closed for good. And even as Wall Street profits soar, the city’s unemployment rate stood at 9.8% in September, with job growth lagging behind the pace that some economists had predicted last spring.

Advertise with us

Mr. Adams will also inherit a budget gap of about $5 billion that will require immediate action, said Andrew Rein, president of the nonpartisan Citizens Budget Commission. There will also be contracts to negotiate with city workers and eventually, the expiration of federal funds for some city priorities.

“Every decision has long-run implications,” Mr. Rein said. “If you start sooner, you can take care of it. When you’re in an emergency situation, it’s hard to make good decisions that are not painful.”

There is no issue Mr. Adams has discussed more than public safety.

Mr. Adams, who grew up struggling with poverty in Queens and Brooklyn and says he was once a victim of police brutality, spent his early years in public life as a transit police officer and later a captain who pushed, sometimes provocatively, for changes from within the system. That experience cemented his credibility with older voters of color, who may mistrust some officers while also worrying about crime.

During the primary, amid a spike in gun violence and jarring attacks on the subway that fueled public fears about crime, Mr. Adams emerged as one of his party’s most unflinching advocates for the police maintaining a robust role in preserving public safety. He often clashed with those who sought to scale back law enforcement’s power in favor of promoting greater investments in mental health and other social services.

Advertise with us

Mr. Adams, who has said he has no tolerance for abusive officers, supports the restoration of a reformed plainclothes anti-crime unit. He opposes the abuse of stop-and-frisk policing tactics but sees a role for the practice in some circumstances. And he has called for a more visible police presence on the subways.

The public safety issue remained on the minds of some voters on Tuesday.

“Hopefully, since he used to be in NYPD, he could get everything amicable again with the city and the NYPD, because it’s been very dangerous out here,” said Esmirna Flores, 38, as she prepared to vote for Mr. Adams in the Bronx.

Yet other voters said Mr. Adams’ emphasis on policing stoked misgivings. And he will certainly face resistance on the subject from some incoming City Council members.

Tiffany Cabán, a prominent new member who was endorsed by the Democratic Socialists of America, said that on many issues, from expanding bus and bike lanes to expanding New York City’s crisis management system, she was “ready to be collaborative.”

“Then you’ll see that there are times where there will be tension,” Ms. Cabán said. After emphasizing potential areas of common ground on public safety matters, she pointed to the prospect of Mr. Adams’ more assertive policing policies and added: “We’re going to be ready for a fight on those things.”