LEWISTON — Shane Bouchard won the runoff to be the next mayor of Lewiston.

In a dramatic turnaround from November, Bouchard overcame his progressive opponent, Ben Chin, who had come out on top last month.

The unofficial tally gave Bouchard a 145-vote victory, receiving 3,663 votes to 3,518 for Chin.

The winner will replace longtime Mayor Bob Macdonald, who was term-limited after three consecutive two-year terms. Chin lost to Macdonald in a runoff election in 2015.

During the Nov. 7 election, Chin received more than 40 percent of the vote, with 4,239 votes that included 1,280 absentee ballots. Bouchard entered the runoff by besting the three remaining candidates with 29 percent of the vote, or 2,979 ballots.

In Lewiston, a runoff is held between the top two candidates if neither receives a clear majority – 50 percent plus at least one vote.

The extra month of campaigning remained mostly civil and issues-oriented, but had grown more contentious on social media in the final week.

The state’s two major political parties also became more visibly involved, and each candidate received high-profile endorsements. Chin received a video endorsement from Sen. Bernie Sanders of Vermont, while Bouchard was endorsed by Gov. Paul LePage and Sen. Susan Collins of Maine.

Both candidates knew that Tuesday’s winter weather would be a factor and used social media to offer voters free rides to the polls. About 10,000 people voted in November, and about 8,200 voted during the mayoral runoff in 2015.