After a campaign marred by racist attacks, the victory Tuesday of a Somali-American woman who won a city council seat in Lewiston, Maine garnered national attention for the winner.

Safiya Khalid, who came to the U.S. in 2006 as a refugee, became the first Somali-American to be elected to city council in Lewiston, a city with a long history of racism against its immigrant community.

Khalid told supporters and the press on Wednesday that her victory was the result of a commitment to connecting with voters—even as online trolls were harassing her with comments saying, as the Washington Post reported, "that Muslims had no place in American government and she should go back to where she came from."

"Community organizers beat internet trolls," Khalid told supporters after results came in Tuesday night.

The 23-year-old is also the youngest person to ever be elected to the city council. She told reporters that she was inspired to run for office after seeing the city grow more racially and ethnically diverse while the government remained homogenous.

"Lewiston needs change, it deserves change, and I think we need a lot of perspectives on the city council," Khalid told Reuters. "The local government needs to be reflective of the community."

‘Lewiston needs change’: Safiya Khalid becomes the first Somali-American to be elected to city council in one of Maine’s largest cities pic.twitter.com/tBy8EgDO9k — Reuters (@Reuters) November 6, 2019

In addition to ensuring that the city's sizable immigrant population's voices are represented, Khalid aims to secure a $30 million federal housing grant; force code officials to regularly inspect every rental unit to make sure they meet lead and other safety standards; and push for low- or no-interest loans for homeowners.

Khalid's victory earned praise from national politicians including Rep. Ilhan Omar (D-Minn.), the first Somali-American to serve in Congress.

"You might smear us. You might hurl racist attacks at us," Omar tweeted. "But we will always rise up to serve our communities."

You might smear us. You might hurl racist attacks at us. But we will always rise up to serve our communities. Congratulations, Safiya! https://t.co/Q7IrAEdWee — Ilhan Omar (@IlhanMN) November 6, 2019

Haters gonna hate but they are no match for resilience and hard work. Congratulations Safiya Khalid on your historic victory! Lewiston will be well served by your leadership. #mepoliticshttps://t.co/a75Wj9WISC — Chellie Pingree (@chelliepingree) November 6, 2019

Safiya Khalid didn’t just become the first Somali person to win a seat on the Lewiston, Maine City Council, she became the youngest person ever to get elected to that body. Congratulations, @Safiya_S_Khalid! You’re an inspiration.https://t.co/aualcxyRHp — Julián Castro (@JulianCastro) November 6, 2019

Tuesday's result comes amid heightened anti-immigrant sentiment in the U.S. that's been encouraged by President Donald Trump and his policies, including the so-called Muslim ban under which travelers from Somalia and other countries are currently barred from entering the United States.

In recent decades, refugees and immigrants in Lewiston have faced attacks by white supremacists; a former mayor who wrote an open letter to Somali-Americans saying the city was "maxed-out financially, physically, and emotionally" and unable to welcome them; and local Republican politicians.

The progressive group Run for Something, which endorsed Khalid, called her win after facing "overwhelming odds" a potential "inspiration" for others who may consider running for public office.

Let @Safiya_S_Khalid's win last night serve as inspiration to run for something. Despite overwhelming odds, Safiya won her race for Lewiston City Council becoming the first Somali-American to hold the position.https://t.co/L28lkQBtNG — Run for Something (@runforsomething) November 6, 2019

"No election is too small," tweeted Ashley Allison of the Leadership Conference on Civil and Human Rights. "ALL elections matter and have the potential to shape how we become a more inclusive nation."