ON A recent evening Rob Quist ambled into a bar in Bozeman dressed in a Stetson and black jeans. He cleared his throat and recited a rhyme he had composed. “Montana…She’s slow to grant her favours to come-lately, newer faces./To long-time suitors, she reveals her hidden, secret places./She lives in big-time splendour; she’s the heart of the golden West./And all manner of wondrous creatures live and suckle at her breast.”

The occasion was not a beer-and-poetry night but a congressional campaign rally. On May 25th Mr Quist, a country-and-western singer and fourth-generation Montanan, will compete as a Democrat in a special election for Montana’s sole congressional seat, vacated when Representative Ryan Zinke was appointed secretary of the interior. Republicans have held the seat since 1996. But the polls, few as they are, suggest that Mr Quist is closing the gap with his opponent, businessman Greg Gianforte, a “newer face” originally from New Jersey who lost the race to become Montana’s governor last November.

Neither man has much political experience. Mr Quist has spent the past decades performing music and poetry—sometimes, as his opponent relishes pointing out, at nudist resorts. Mr Gianforte is best known for starting a successful technology business and for his support of Bible-literalist causes. He chaired the board of a school in Bozeman that teaches evolution as “one of several theories of existence”, and has donated to a dinosaur museum in Glendive which claims that the earth is around 6,000 years old and that dinosaurs stomped about on Noah’s ark.

A strong showing in April in another special election, for a Republican-held seat in Georgia, has excited Democrats. Montana’s contest is being similarly interpreted as a litmus test of Mr Trump’s unpopularity. But this election may say more about Montana’s curious brand of politics than about national trends.

In November Montanans handed Mr Trump a landslide victory over Hillary Clinton while at the same time voting for Steve Bullock, the incumbent Democratic governor, over Mr Gianforte. Although the state has backed Republicans for president and for Congress since 1996, since 1911 at least one of its senators has always been a Democrat. In an office decorated with family photos, football helmets and paintings of Montana landscapes, Mr Bullock wonders whether Montana’s emptiness partly explains the state’s erratic voting tendencies. “We have 1m people spread out over a huge territory. There’s a sense of individualism, but also a recognition that you have to take care of your neighbour.”

Dale Martin, a historian at Montana State University, says Montanans, like most states of the Rocky Mountain West, have long had an ambivalent relationship with the federal government: libertarian by instinct, but reliant on federal subsidies for highways, mining and agriculture. According to The Tax Foundation, a think-tank, federal aid accounted for 39% of general revenue in 2014, making it the fourth-most-dependent state in the country.

Both candidates are trying to walk a difficult line. At an event in Butte, a run-down mining town, Mr Gianforte castigated federal overreach while cheering the idea that “public lands remain in public hands”. (His campaign for governor failed partly because of stories that he had sued to block public access to a fishing river in front of his Bozeman estate.) At his bar-room rally, Mr Quist championed liberal causes like reproductive rights, universal health care and economic equality. But to prove his gun-friendliness, he also taped a campaign advertisement in which he shoots at a TV screen playing an attack ad against him.