BELFAST, Maine — The tight race to become a Waldo County commissioner took another twist on Tuesday.

Democrat Betty Johnson of Lincolnville, who had lost by five votes after last Tuesday’s election, learned from the Maine Secretary of State’s Office that she now has won the seat by eight votes after overseas and military ballots were tallied and Belfast write-in ballots were reviewed.

Incumbent Republican Donald P. Berry Sr. of Belmont already has filed his request to have a recount.

“It’s gone totally back and forth,” he said Tuesday. “Neither of us, I believe, will be counting the chickens before they hatch.”

Johnson agreed.

“It’s not settled yet,” she said.

The latest vote tabulation has Berry with 2,879 votes and Johnson with 2,887 votes.

Secretary of State Matt Dunlap said that it is the first year that ballots from military residents and others living overseas were counted in Augusta instead of in municipalities.

“When we did the [Uniformed and Overseas Citizen Absentee Voting Act] evaluation, it was enough to turn the vote around,” he said.

According to Deputy Secretary of State Julie Flynn, while more than 600 votes from overseas were returned by Election Day, only seven were in the contested commissioner’s district — and all of those were marked for Johnson.

“Those ballots are going to be available and recounted as part of the recount,” Flynn said.

Ballots for the Waldo County commissioner’s race will be recounted at the Maine State Police headquarters in Augusta, she said.

Other contested races for the state House and Senate will need to be recounted first, she said. Those are for Senate District 7 in Cape Elizabeth, South Portland and part of Scarborough, House District 37 in the Blue Hill area, House District 131 in Buxton and Hollis, and House District 109 in Gray, North Yarmouth and Pownal. Another recount also will be done first to determine the district attorney for both Hancock and Washington counties.

Regarding the Waldo County commissioner’s race, Flynn had already asked Belfast election officials to review the city’s write-in ballots because of discrepancies in the number of ballots and number of votes.

One reason for that outcome is that ballots with write-in names for elected office are separated by the machine into a bin and then hand-counted by election officials, but on election night in Belfast, some ballots had every vote counted twice — once by hand and once by the machine.

“I don’t want people to think that this is what was happening all over the place,” Flynn said.

It was the first election for new Belfast City Clerk Denise Beckett and some of the officials also may have been fairly new, Flynn said.

Addition and tallying errors were apparent to the clerk, Flynn said, but without reviewing the ballots it was not possible to determine where the errors originated.

While numbers changed in other races after the ballots were reviewed by Belfast election officials, the results were not altered and no other races were close enough for candidates to request a recount.

After the review, Johnson had a one-vote lead instead of a five-vote deficit, which turned into an eight-vote lead after the overseas ballots were factored in.

Berry said that he has many questions about election night, particularly the changing numbers on his race’s votes and the seven Democratic ballots coming from overseas.

“Both of us are totally in doubt about where it’s going to go,” he said.