PORTLAND, Maine — Pious Ali became the first African-born Muslim elected to Portland’s City Council Tuesday night, while first-time candidate Brian Batson defeated Councilor Edward Suslovic to win the other open seat.

In an election when immigrants were portrayed as a threat to the country, the Ghana-born school board member earned 63 percent of the vote, with incumbent at-large Councilor Jon Hinck and challenger Matthew Coffey trailing with 20 and 17 percent of the vote respectively, according to the city’s final, unofficial tally.

Ali, a University of Southern Maine community outreach specialist, benefited from historic fundraising. His campaign brought in over $20,000 between July and Oct. 25 — more than any candidate in a recent council race and more than all of this year’s other candidates combined. Much of the money in Ali’s war chest came from donors nationwide through a political action committee, and the candidate effectively capitalized on Republican presidential nominee Donald Trump’s anti-immigrant stance in fundraising emails. Suslovic, on the other hand, raised no new funds in his race.

“Thanks to all of you who supported me, to the young people who went knocking on doors with me,” Ali said during a short speech at an Old Port restaurant. “Hopefully when the time for the real work comes and I reach out to you again and say, ‘Hey, can you work with me?’ We can make Portland the best that it can be.”

Ali made history in 2013 when he was elected to the school board, becoming the first African-born Muslim to hold public office in Portland.

In the campaign between Hinck and Ali — two progressive Democrats — the policy differences were often a question of emphasis rather than position. But the two candidates broke on a proposed $70 million bond to repair four of Portland’s aging elementary schools. As a school board member, Ali voted for the full sum, but on the council, Hinck expressed concern that it would require a tax hike and suggested he’d support a smaller amount with support from the state.

In District 3, Batson bested Suslovic, 53 percent to 47 percent, according to the city’s final, unofficial tally.

Batson, a nurse at Maine Medical Center, was prompted to run after the City Council voted to shut down the India Street Public Health Center, the Portland Press Herald reported. Suslovic supported closing the clinic.

Late Tuesday, Batson thanked campaign volunteers and said he’s excited to represent District 3.

“It’s an amazing victory, and I think it’s a good victory for the city of Portland in terms of progressiveness and in terms of prioritizing health and safety,” he said.

In this historically divisive national election, many Portlanders said that the pyrotechnics of the presidential race and Maine’s six ballot questions had left them little attention to devote to the local races.

Sukhi Singh, 33, said that he’d grappled with how to vote in the presidential election before eventually casting his ballot for Trump based on the candidate’s immigration policy. But moments after leaving the polling place at Deering High School, Singh was uncertain of how he’d voted in the at-large council race.

For some black and Muslim Portlanders, however, the at-large council race was a turning point. They saw a vote for Ali as an opportunity to see themselves reflected in local government.

First-time voter Sharmarke Ali, 29, said that he’d registered this year after not voting in previous elections to cast a ballot against Trump and one for Pious Ali. He said he’d voted for Ali because he believes the candidate with whom he shares race, faith and a last name understands the needs of Portland’s immigrant community.

“This one I couldn’t miss,” he said. “I hope there are more opportunities for the immigrant kids. I know they are underperforming in schools.”