GREAT FALLS, Mont. — Republican Steve Daines, the freshman senator in this sparsely populated state of hunters, anglers and big-government skeptics where President Trump crushed Hillary Clinton four years ago, was supposed to coast to reelection in November.

Democrats were mounting a modest field to oppose him. Daines, if not defined by legislative wins in Washington, had forged a close alliance with the president. He’s a reliable conservative in a state that has voted Republican for president every year since 1968, except for Bill Clinton 28 years ago.

Then came Steve Bullock and the coronavirus pandemic. And with less than three months until Election Day, the faceoff between the two-term Democratic governor from Helena and the wealthy former software executive from Bozeman has transformed into a margin-of-error race that has helped put Senate control within reach for Democrats. It will measure whether Montana’s proud history of political individualism is sustainable in an era when voters are more polarized than ever.

Bullock, a moderate who last year ran a long-odds campaign for the Democratic nomination for president, got into the Senate race relatively late in March, relenting to pressure from top Democrats in Washington who saw an opening in a conservative-leaning state with a key distinction from its neighbors Idaho and Wyoming.

Montanans, stubbornly independent, like to split tickets. And Bullock, a lawyer who narrowly won reelection to the governor’s mansion in 2016 on the same ticket Hillary Clinton lost by 20 points, is betting that voters will send him to Washington even as they’re expected to support Trump — albeit by a smaller margin than four years ago.

“Montanans vote for the person,” said Jon Tester (D), the state’s senior senator who fended off a Trump-backed challenger in 2018. “They actually think about it.”

Much of the congressional landscape this campaign season is taking shape as a referendum on how Trump has responded to the virus, which has exploded here to about 5,000 cases, still a small fraction of the count in more crowded states but among the highest percentage increases in recent weeks.

As the only sitting governor vying for a Senate seat, Bullock has benefited from the much-criticized federal retreat on the virus, political observers say, both in visibility by shutting down Montana sooner than many states and in a deft balance of public health measures with the don’t-tell-me-what-to-do streak shared by many of his constituents.

The pandemic has challenged Daines to underscore what he’s done in Washington in the face of Trump’s inaction and the stalemate on Capitol Hill over new relief. But the senator is banking that voters will choose conservatism on a ballot that will also determine a new governor, Montana’s lone House member, attorney general and other statewide offices in a state where Trump signs are scattered from river valleys to wide-open plains.

“The first mistake most people make is they think Montana is a red state,” said David Parker, a political scientist at Montana State University in Bozeman. “It’s a populist state that can work well for Republicans and Democrats.”

It’s also attracting an influx of newcomers from liberal-leaning cities, which has brought Democrats and teleworkers to the fast-growing Bozeman area in the southwest as rural enclaves in eastern Montana solidify their conservatism. The economy is increasingly divided between its high-tech, tourism-driven west and its farming, mining and energy-producing east.

At their first of three one-on-one matchups Saturday night, an hour-long debate televised from their homes, the candidates cast each other as too extreme for Montana. Bullock called Daines a captive of special interests who voted for Trump’s tax-cut law with its breaks for big corporations while “Montana got scraps.” Daines warned that Bullock would bring a “radical, job-killing, liberal agenda” to Washington under the influence of Democratic leaders Nancy Pelosi and Charles E. Schumer.

Two statewide incumbents

The pandemic has forced questions of effectiveness to center stage in a contest featuring two statewide incumbents, with each seeking to establish himself as a bipartisan achiever for constituents 2,000 miles from Washington. Bullock, elected attorney general before winning two terms as governor, is casting Daines as an ineffective senator who’s done an about-face on health care, public lands and other issues.

“Montanans know me, they know how I work,” Bullock, 53, said in an interview. “We’re working with FEMA to get viral swabs and he puts out a press release taking credit for helping Montanans get through this.” Bullock is pressing his success winning GOP legislative support to demand more transparency about money in politics, protect public lands and expand Medicaid.

Daines, 57, who served one term in the House before winning his Senate seat in 2014, is depicting the governor as far left of where Montanans are comfortable, starting with his run for president.

“The concern is, what positions do you take when you’re in Montana and what positions do you take when you’re outside?” the senator said in an interview. “We have a leave-us-alone spirit, and I don’t think Montanans want to see one-party rule in Washington.” He’s trumpeting tax cuts he pushed for small businesses in the 2017 GOP tax-cut law, relief from a long ban on beef exports to China and a bipartisan conservation bill Trump signed last week.

Montana, which doesn’t register voters by party, has long lacked reliable polls. Political handicappers have rated the race a toss-up, though.

The campaign already has shattered statewide fundraising records. Daines had raised $13 million as of June 30 and Bullock $11 million. Outside groups poured $3.8 million into Bullock’s race and $3.5 million to support Daines as of last week, a sign of the intense national interest in the race.

Even with their rising profile, the candidates are hard to find campaigning as they bow to the reality of the pandemic and forgo the long distances they normally would cover to reach a population of about 1 million — with an average of six people to a square mile.

They’re relying for visibility on official events with limited participants, which sometimes leads them to the same stage.

Bullock appeared this month at a federally funded health-care clinic in Helena whose clients include Native Americans and low-income Montanans who’ve lost their jobs in the pandemic. He announced new coronavirus relief grants from Washington to enroll them in affordable insurance through the Affordable Care Act.

Events like these help Bullock amplify a key feature of his campaign that he has intertwined with his efforts to fight the virus: He worked with Republicans in Helena to expand Medicaid at a time when many Montanans are relying on public insurance.

It’s a sharp contrast to congressional Republicans, who are still trying to push the Supreme Court to get rid of the Obama-era health-care law — and with Daines, who voted to repeal Obamacare but now supports measures in Congress to guarantee coverage of preexisting conditions.

Daines, meanwhile, has tried to steer his opponent’s focus on health care to a mistrust of the federal government, claiming at Saturday’s debate that Bullock’s support for the Affordable Care Act means he supports “a complete federal takeover of the health-care system.” Bullock has denied that charge.

Trump and the pandemic

Where Trump is concerned, the candidates have stepped lightly, each knowing they need to peel away independent-minded voters on Nov. 3. After accusing Trump of having the back of white supremacists and of “using race, gender and geography to divide this country” during his campaign last year, Bullock now emphasizes that he defied former president Barack Obama when he disagreed with his policies — “multiple times.”

Daines has long worn his alliance with Trump as a badge of honor, noting that a call to the president last year got him to stop the Agriculture Department’s proposed closures of numerous Job Corps programs. On Saturday, asked to rate the president’s response to the pandemic, he sidestepped the question at first, saying, “We need to come together.” When pressed, he offered, “President Trump has led boldly. I’m grateful for his leadership.”

Daines has also echoed Trump’s decision to blame the pandemic’s spread in this country on China, which has opened him to criticism from the Bullock campaign of his years of work there for Procter & Gamble.

The senator also has sought to neutralize attacks by Democrats who disparage Republican support in the West for business interests that encroach on public lands with his biggest legislative victory: a massive land conservation and park maintenance law Trump signed last week that Daines and Sen. Cory Gardner (Colo.), another Republican in a tough race, convinced the president to support.

It’s the pandemic that’s foremost in many voters’ minds. “We’re all masked up, and that’s where Bullock did a good job,” Keith Dordrum, 64, a retired postmaster, said as he walked his golden retriever in downtown Great Falls at lunchtime with his wife, Janet. They acknowledge they’re liberals in an extended family of deep conservatives.

“Personally, I think he’s done as good a job on the virus as anyone could do,” Janet Dordrum, 62, a retired nurse, said of Bullock in the face of the surge in cases.

Across the Missouri River, Bob Schreck sees the virus — and the Senate race — a lot differently from his perch as bartender at the VFW Post in Black Eagle, a fading community whose heyday as a smelter town for Montana’s copper mines is long gone.

Schreck, 66, said he “hasn’t tracked” Daines yet. But the Air Force veteran, who came here from Texas to serve and never left, is exactly the kind of voter the senator is counting on.

“To tell you the truth, would he back us in Montana if he made it to the Senate?” Schreck wondered of Bullock as he mixed a drink for a customer, maskless. “I think he’d fall to the left. And I want my freedom.”

Schreck says he loves Trump. And he’s skeptical of the government’s count of virus deaths. “Definitely the numbers are inflated,” he said.

Bullock’s handling of the virus has tested him with voters like Schreck, even as he’s credited with keeping infection rates relatively low. After he announced a mask-wearing mandate in public places in July, opponents protested in front of the governor’s mansion in Helena.

“We celebrate their right to protest,” Bullock said. “I just wish they would do it safely.”