PORTLAND, Maine — Republican U.S. Sen. Susan Collins of Maine won the hardest-fought race of her career, turning back a challenge by Democrat Sara Gideon and winning a narrow majority in the costliest political race in state history.

The outcome, announced on Wednesday, a day after voting ended, gave the 67-year-old incumbent a fifth term in office and dealt another blow to Democrats' hopes for taking control of the GOP-led U.S. Senate.

Speaking as Elton John's "I'm Still Standing" played, Collins thanked Gideon, the 48-year-old speaker of the Maine House, for a "gracious" concession.

"To the people of Maine, thank you. I will serve you with all my heart. I will work hard for you each and every day. And together, we will come together to work on the problems and challenges that are facing our state and our country," Collins told supporters in Bangor.

In Portland, Gideon thanked her supporters in a video address that was transmitted live, but without reporters being present.

"While we came up short, I do believe Mainers in every corner of this state are ready to continue to work together to make a difference," Gideon said Wednesday during the speech.

Republican incumbents proved resilient after tough reelection campaigns, with senators like Collins and South Carolina U.S. Sen. Lindsey Graham triumphing over well-funded challengers. The only two Republican incumbents to go down so far are in Colorado and Arizona.

In Maine, the Senate race was the most expensive political race in state history by far, with Gideon raising nearly $70 million, more than double the $27 million that Collins raised. But that didn't include millions of dollars of so-called dark money. All told, more than $120 million was spent by both candidates and their allies on advertising.

Collins, one of four candidates on the ballot, won a slim majority of first-place votes, collecting about 51%. That meant no additional tabulation rounds were necessary under Maine's ranked choice voting system.

Republicans cast Gideon as a wealthy liberal and a risky choice while Collins touted herself as a centrist who's willing to work with both parties. Collins also highlighted her ability to get things done, pointing to the Paycheck Protection Program — for which she was lead author — as helping businesses during the pandemic.

Gideon, meanwhile, tried to link Collins with President Donald Trump and Senate Majority Leader Mitch McConnell while pressing her message that Collins cares more about her party than Mainers.

Gideon, originally from Rhode Island, moved to Freeport, Maine, 15 years ago. She has ascended quickly into politics and was elected to the Legislature in 2012 after serving on the Freeport Town Council.

Collins is a native of Maine, raised in Caribou, where she picked potatoes as a kid, and touted her familiarity with Maine's unique issues.

In other developments:

— Democratic U.S. Rep. Jared Golden defeated Republican Dale Crafts in the 2nd Congressional District with a majority of the vote, earning a second term. U.S. Rep. Chellie Pingree retained her 1st Congressional District seat, defeating Republican Jay Allen to secure a seventh term.

— In the presidential race, Democrat Joe Biden collected three of Maine's four electoral votes by winning a majority of the statewide vote and a majority of the vote in the 1st Congressional District. But Trump won a majority in the more rural and conservative 2nd Congressional District to claim one electoral vote, as he did in 2016.

— Maine Democrats said they retained control of the Maine Legislature, while Maine Republicans said they narrowed the Democrats' margin of seats in the state House of Representatives. AP had not called enough races to determine which party would control it.