City Council member Andre Dickens was elected mayor of Atlanta on Tuesday, defeating Council President Felicia A. Moore in a runoff election to decide who will lead the city through a host of challenges, including a surging homicide rate and a shortage of affordable housing.

Dickens, 47, will replace outgoing Mayor Keisha Lance Bottoms, who announced in May she would not seek a second term.

Considered a long-shot candidate just a few months ago, Dickens cobbled together a coalition of support from Black voters as well as younger White residents who continue to move into neighborhoods near the city’s downtown.

In a rousing speech to his supporters shortly after 11 p.m., Dickens said he has been repeatedly underestimated during his political career but that he “scrapped and scraped and fought” to get his message out to voters.

“The believers did it again, and they believed that this city needed a unifier,” Dickens said. “Someone who could bring this whole city together, and tonight, tonight, I’m beyond humbled that you have chosen me and elected me to be the 61st mayor of this great city.”

Dickens vowed he would immediately get to work to solve “generational problems” including homelessness, income inequality and violent crime.

During the final days of the campaign, Bottoms endorsed Dickens, calling him a charismatic and unifying leader who could help the city rebound from the coronavirus pandemic. Dickens, a Democrat, also picked up an endorsement from Fulton County District Attorney Fani T. Willis.

Dickens, who has a degree in chemical engineering, also works as the chief development officer at a local nonprofit agency. Although he has held his citywide council seat since 2013, many voters considered him to be more of an outsider than Moore, who is 60 and has served on the council since 1998.

On the campaign trail, Dickens defended his vote on the council last year to shift resources away from the police department to bolster spending on mental health services. He also touted his push in 2019 to create Atlanta’s first Department of Transportation, which helped him win support from bicyclists and environmental activists who saw him as a more visionary leader than Moore.

Tuesday’s runoff was held after none of the 14 candidates in the Nov. 2 election received more than 50 percent of the vote.

Moore, also a Democrat, was the top vote-getter in that election, in which she won 41 percent of the vote. Dickens surprised many pundits by narrowly edging past former mayor Kasim Reed (D), hobbled by ethical controversies within his past administration, to also secure a spot in the runoff election.

“I’ve said before, my real opponents in this race were never one of those 13” other candidates,” Dickens said in his victory speech late Tuesday. “My opponent is homelessness, hopelessness, joblessness, racism, poverty, violence. My opponent has been around for 50, 100, 2,000 years. . . . My opponent requires all of us, and that is what we are fighting against.”

As mayor, Dickens will immediately be confronted with a violent crime epidemic and sagging morale within the police department.

Amid last year’s pandemic, Atlanta recorded 157 homicides, the most in more than two decades. Homicides have continued to rise, with at least 141 so far this year, a 10 percent increase over this time last year.

During the campaign, Moore sought to use the crime issue against Dickens, noting that he was one of seven council members who voted in 2020 to temporarily slash police funding and shift the resources to social service programs.

Dickens countered that his vote was designed to relieve Atlanta police from having to respond to “non-emergency” calls, including mental health crises. He in turn criticized Moore for not being forceful enough in criticizing allegations of police misconduct.

The debate over policing comes as the Atlanta Police Department has been in upheaval during the past 18 months.

Last summer, just weeks after a Minneapolis police officer murdered George Floyd in Minneapolis, a White Atlanta police officer shot a 27-year-old man, Rayshard Brooks, in the back as he was attempting to flee.

The shooting intensified the ongoing protests against racial injustice and sparked widespread community outrage. Bottoms quickly moved to fire the officer, which outraged officers who said they felt abandoned by city leaders.

The discord within the department has hampered officer retention and hiring efforts, leaving the city with about 350 fewer officers than the department’s authorized force of 2,050. Moore and Dickens both vowed to quickly try to hire more officers and work to improve morale within the department.

But the city’s public safety crisis continues to drive an effort by some residents of the wealthy Buckhead neighborhood to secede from Atlanta and form an independent Buckhead City, which will pose a major leadership challenge for the incoming mayor.

In a statement, the Buckhead City Committee said it is pressing ahead with plans to get the Republican-controlled Georgia legislature to authorize a referendum on the matter next November.

The leaders of the committee, who have already opened a campaign headquarters, argue that an independent city would provide more effective policing and service delivery in an area known for its upscale shopping mall, luxury apartment buildings and some of the city’s grandest mansions.

If Buckhead residents do vote to leave Atlanta, shifting some of its wealthiest residents into a new city, Atlanta’s government would lose about $100 million in annual tax revenue. The city school system could lose more than twice that amount each year, according to a recent fiscal impact statement.

Even if Buckhead remains in Atlanta, the new mayor will have to manage demographic changes that have left some low-income residents feeling as they are being priced out of historically Black neighborhoods.

A hub of medical, entertainment and technology companies, Atlanta’s skyline continues to be transformed amid the rapid redevelopment of the city’s Midtown neighborhood.

The development has spurred an influx of White residents, who now make up 38 percent of the population, according to census data. African Americans account for less than 50 percent of Atlanta residents for the first time since the 1960s.

The growth has driven up housing prices, especially along the city’s Beltline. The Beltline project includes a 22-mile loop of transit, multiuse trails and parks that will eventually connect 45 neighborhoods that ring downtown.

Some Black residents view the project skeptically, fearing it will accelerate gentrification. The median house price in Atlanta has already soared to $390,000, an increase of more than $100,000 over the past five years, according to Redfin.

Rents are also rising at twice the national average, the Atlanta Journal-Constitution recently reported.