San Francisco Supervisor London Breed emerged victorious Wednesday to become the city’s first African-American woman mayor after narrowly defeating a rival who was seeking to become the first openly gay man in the position.

It took eight days of counting after Election Day for Breed to build a large enough lead to claim the city’s top job. With about 250,000 ballots tallied, she led former state Sen. Mark Leno by 2,177 votes with only about 6,700 left to count.

Leno called Breed to congratulate her on the victory and later she appeared briefly before reporters and cheering supporters on the steps of City Hall. She said she was humbled, honored and looking forward to serving as mayor.

In particular, she relished the message her election sends to San Francisco’s youth, especially kids like herself who grew up poor.

“No matter where you come from, no matter what you decide to do in life, you can do anything you want to do,” she said. “Never let your circumstances determine your outcome in life.”

Breed, who will take office next month, is the second woman to be elected mayor in San Francisco history. The other was U.S. Sen. Dianne Feinstein.

Breed, 43, vowed to be mayor for all of San Francisco, a message she repeated throughout her bid to lead a city that is economically thriving but mired in homelessness, congestion and unaffordable homes. She has vowed to rid the sidewalks of homeless tent camps within a year of taking office.

Breed will fill the rest of Lee’s term, which ends in early 2020, and will need to run in November 2019 for a full four-year term.

The portrayals of her as a lackey of big business bugged Breed, who first won a supervisor’s seat in 2012.

“I ask people to not attribute what I’ve done —my success and how hard I’ve worked— to not reduce that or attribute that to someone else,” Breed told the AP in a pre-election interview.

At City Hall, she paid homage to her late grandmother and said she probably had a hand in her win.

“She took care of the community, she took care of me even on days when I didn’t deserve it, and so being here in her honor means so much,” she said.