The counting has begun, but it might take a while.

Polls closed across Maine at 8 p.m. and all eyes are on Maine’s long and hard-fought governor’s race.

Republican Paul LePage has been the clear front-runner from the start, while independent Eliot Cutler is hoping to ride a last-minute surge to victory. Democrat Libby Mitchell remained competitive heading into the final days, but clearly struggled as a longtime legislator in an election year when voters demanded change.

Independents Shawn Moody and Kevin Scott became household names but never reached double-digits in the polls.

The campaign began more than a year ago and at one time included a field of more than 20 candidates. It was an unusually rough and tumble race for Maine, with attack ads on television and in direct mailings in recent weeks. It also featured more debates and more horse-race polls, many of them conflicting, than perhaps any gubernatorial election before it, experts said.

Many voters also had an unusually difficult time making up their minds this year.

Recent polls put the number of undecided voters as high as 15 percent, although even more voters were changing their minds up until the last minute, especially between Mitchell and Cutler.

Secretary of State Matthew Dunlap is predicting a 50 percent to 55 percent turnout. Dunlap said 40 percent of Maine’s ballots are still hand-counted, so a close gubernatorial race might not be decided until early Wednesday. A really close race might take even longer to sort out, he said.

Dunlap said he is expecting a close finish. That’s partly because of the results of the Maine Student Mock Election, which has been a good predictor in the past.

In that contest, LePage won with 28.2 percent, while Cutler got 27.3 percent and Mitchell got 23.5 percent.