Safiya Khalid, 23, speaks with a resident in the Michaud Meadows subdivision in Lewiston in August.

Safiya Khalid defeated a fellow Democrat on Tuesday to win a seat on the Lewiston City Council.

That makes Khalid, 23, the first Somali American elected to the council. She is also the youngest person to hold a seat on the council. Khalid won with 69.6 percent of the vote, according to unofficial results.

On Tuesday night, Khalid called her campaign proof that “community organizers beat internet trolls”

Khalid ran unsuccessfully for school committee in 2017, when she was 20 years old and a senior psychology student at the University of Southern Maine. Khalid told the BDN earlier this year that she was motivated to run by what she saw as a lack of diversity in Lewiston’s city government at the time.

[Meet the woman who wants to be the first Somali-American on Lewiston’s City Council]

She received political training through Emerge Maine, which helps Democratic women who want to run for office. Khalid also serves as vice chair of the party’s Lewiston chapter and has an executive seat on the state committee.

The Ward 1 seat was held by Jim Lysen, who did not run for re-election.

The race became a source of controversy as infighting among Democrats spilled into the public. Democrat Walter Hill mounted a campaign against Khalid after her opponent, Linda Scott, dropped out of the race, potentially leaving Khalid running unopposed.

An audio recording uploaded to YouTube just days before the election allegedly captured Lewiston Democratic Party Chair Kiernan Majerus-Collins calling Hill a “coward” and “pathetic” for not coming to the door to explain his decision to run against Khalid.