Maine Republican Sen. Susan Collins has won her seat for the fifth term, bringing to an end a close and fiercely fought race that drew in millions of dollars from out-of-state donors.

Democratic challenger Sara Gideon on Wednesday afternoon announced that she called Collins to concede the race that Democrats hoped would help to flip the Republican-led U.S. Senate.

"I congratulated her on winning this election and I told her that I always will be available to help serve the people in Maine,'' Gideon said in a recorded speech.

The race’s outcome is a surprise to many who were following polls showing Gideon with a slight lead. Colby College Professor of government Dan Shea said much of Collins' support came from voters in rural areas who went apparently unheard by pollsters.

“Susan Collins did very well, exceedingly well, in the rural parts of the state,’’ he said. “My best guess is that pollsters are not quite able to try to connect with, and hear from, a group of voters that have been very important in the era of Trump.”

Among those surprised by the outcome was James Cook, a political activist and sociology professor at the University of Maine who has been canvassing for Gideon for several weeks.

On Wednesday morning, Cook said he was spray painting over his placards for Gideon with a “Count Every Vote’’ message. He planned to join a group of Mainers that afternoon to rally in mid-coast town Rockland to call for continued vote counting in the presidential race.

“I cried this morning and now I’m trying to move on,” he said. “I’m moving on to the part we can control now.’’