LEWISTON — Mayor Robert Macdonald and challenger Ben Chin will face each other in a runoff election Dec. 8 after finishing at the top of a field of five candidates in Tuesday’s election.

Chin received 3,673 votes to finish first, and Macdonald was second with 3,107 votes. Since neither got more than 50 percent of the vote, they will face each other in a runoff election that could be a bellwether for the shifting issues that decide state elections.

Stephen Morgan finished third with 1,276 votes, followed by Luke Jensen with 204 and Charles Soule with 72 votes.

A combative Macdonald said after the returns came in that Portland and elected officials from that city played a role in the election.

“I’ll be frank, OK?” he said. “I’m not just running against him (Chin), I’m running against Portland. You’ve got (state Sen.) Justin Alfond and all these legislators down there that are supporting (Chin) because they don’t like me. You know what? Even if I lose I feel good knowing I was a pain. Portland is inserting itself into this election.”

Macdonald noted that Chin and his supporters had raised considerable money for his campaign from outside Lewiston.

“A lot of people around here find it reprehensible that they’re doing something like that,” he said. “Stay down in southern Maine and do what you have to do.”

Chin arrived at Guthries Restaurant & Cafe in Lewiston shortly before 9:30 p.m. to raucous applause.

“You might have heard, but we got the most votes tonight,” he said to cheers.

Chin thanked his supporters but acknowledged that there is “another fight ahead.”

“I’d rather just show you baby pictures,” he said, referring to the birth of his first child on Sunday. “But I’d like to say that this (campaign) was never about getting one person elected. It became about fighting for the soul of a city.”

Macdonald, 68, and Chin, 30, were the focal point of the race. Their candidacies have been viewed by some as a proxy battle between the Maine Republican Party, which has leaned heavily on a welfare overhaul agenda, and the Maine Democratic Party, which suffered bruising losses at the polls in 2014.

The Lewiston race is nonpartisan, but activists from both major parties have been active here. Chin works for the Maine People’s Alliance, a leading advocacy group that has helped Democrats get elected in legislative and gubernatorial contests. The group has been one of the biggest recipients of Chin’s record $63,000 in campaign contributions through the reporting period that ended Oct. 20, according to the Sun Journal. He drew 26 donations from Lewiston addresses and nearly 30 percent from out of state.

Macdonald, who was first elected in 2011 after his opponent died suddenly, raised just $1,567. However, he has been supported by the Maine Republican Party, which created the website “The Real Ben Chin” to highlight Chin’s past effort to allow legal noncitizens to vote in local elections.

“In many ways this race is a microcosm of the statewide debate between Democrats and at least the Paul LePage wing – which is the dominant wing – of the Republican Party,” said Mark Brewer, a political science professor for the University of Maine. “The candidates appeal to very different constituencies in Lewiston, the same way the two major parties in Maine now appeal to very different constituencies statewide.”

In Ward 1, which includes the Bates College area, Chin received 661 votes and Macdonald 234 votes. Sarah Freyd, a first-year student from Washington state, said she registered to vote in Lewiston rather than her home state because she felt her vote would matter more here.

Arianna Fano, 18, of Chicago had a similar motivation. She said local elections offer the best chance to make a difference, and from what she has seen, “Lewiston needs something different.”

Ethan McGinnis of Arlington, Virginia, said he was motivated to vote after seeing some of the negative campaigning against Chin.

“I’m going to be a part of this community for the next four years at least, so it’s nice and important to be able to have a say,” he said.

Ken Cressey, a worker at Bath Iron Works, said he was voting for Chin. He likes Chin’s pro-labor platform. While Cressey said he doesn’t pay a lot of attention to local politics, he is tired of the bickering coming from the mayor’s office.

Macdonald did well in Ward 6, where he got 535 votes to Chin’s 296. Macdonald has relentlessly pushed for changes to the welfare system, stirring controversy that has made national headlines.

The city, with more than 36,000 residents, has been a popular destination for politicians eager to win the affections of a population long dominated by its Franco-American lineage. However, Lewiston also has been changed by an infusion of immigrants, particularly from Somalia. City officials say Lewiston now has as many as 6,000 African-American residents.

Bubbling beneath the changes is a feeling among some that the new residents receive preferential treatment and are resistant to the assimilation mandate once thrust upon early Franco settlers here.

Macdonald, a retired Lewiston police officer and former Maine Republican Party state committeeman, has given voice to that feeling. He is seen as an acolyte of LePage, the Lewiston native who was elected governor on a populist welfare reform platform interwoven with promises to reform the “corrupt” Augusta bureaucracy.

In September, Macdonald made national news with a proposal for an online list with the name and address of anyone who receives public assistance. He was unable to find a legislator to sponsor the proposal.

The mayoral race made national news again in October, when a local landlord posted signs with a caricature of former Vietnamese Communist leader Ho Chi Minh and the words, “Don’t vote for Ho Chi Chin. Vote for more jobs not more welfare.”

Chin is a third-generation American whose grandparents emigrated from China to the U.S. He has sought to appeal to the city’s immigrant population, but he also may have found an issue that resonates with all residents: opposing a pay-per-bag fee for trash disposal. Macdonald has been on the defensive ever since, asserting that his votes to advance the proposal were ultimately geared toward putting the issue to Lewiston voters.