Tester won Tuesday's election despite President Donald Trump taking a personal interest in defeating him. Trump made repeated trips to Montana for that purpose.
"We need to work together in this country," Tester told a crowd of supporters in Great Falls. "We need to hold people accountable for their actions, and we need to make sure we move forward so that we have the strongest middle class ever."
The president vowed last spring that Tester would pay at the polls for sinking his first nominee for Veterans Affairs secretary, White House physician Ronny Jackson. Those comments led to both Republican and Democratic groups spending tens of millions of dollars in an attempt to influence the outcome of the race.
Tester insisted that Montana voters across the political spectrum would support him after examining his record.
The Montana seat was one of 10 held by Senate Democrats seeking re-election in states Trump won in 2016.
Tester, 62, is a farmer and a former music teacher from the small community of Big Sandy who previously served in the Montana Legislature. He won his seat in 2006 by defeating then-U.S. Sen. Conrad Burns. Six years later, Tester beat then-U.S. Rep. Denny Rehberg in his first re-election campaign.
Tester has never won a U.S. Senate election with a majority of the vote, and he said he knew it would be close again this time. He sought to capitalize on a Democratic base outraged by Trump's election and energized by the #MeToo movement against sexual misconduct.
At the same time, Tester tried to appeal to the Trump supporters he needed to win. He cast himself as an independent who would support the president when it was in Montana's interests and oppose him when it wasn't.
Tester repeatedly cited legislation that he helped draft and that Trump signed as evidence he can work with the administration. He said his opposition to Trump's Supreme Court picks, Brett Kavanaugh and Neil Gorsuch, were examples of when he had to go against the president.
Rosendale, 58, was elected state auditor in 2016 and is a former Senate majority leader in the Montana Legislature, where he represented the Glendive area from 2011 to 2017.
He is a real estate developer originally from Maryland who has lived in Montana since 2002. He previously ran for the U.S. House in 2014, where he came in third in the Republican primary and achieved notoriety for an ad in which he pretended to shoot a government drone from the sky with a rifle.
He won a four-way primary in June after the Republicans' first choice to challenge Tester, Ryan Zinke, resigned his U.S. House seat to become Trump's Interior Department secretary last year.
Rosendale made his campaign about backing Trump, who won a landslide victory in Montana in 2016. Rosendale framed himself as a champion of the president's agenda and Tester as selling out Montana's interests for those of the Senate's Democratic leaders.
The race tightened as Trump, eldest son Donald Trump Jr. and Vice President Mike Pence made repeated trips to Montana to rally for Rosendale. The president visited four times after saying Tester would have to pay for Jackson withdrawing his name from consideration as head of the VA amid allegations of workplace misconduct.
Trump blamed Tester, the ranking member of the committee that oversees the VA, for releasing excerpts from interviews with unnamed people who said Jackson drank on the job, overprescribed medication and presided over a toxic work environment.