Sen. Jon Tester (D-Mont.), right, speaks during a debate with Rep. Denny Rehberg on Oct. 8 in Billings, Mont. (Casey Page/AP)

From the very beginning, meaning for about six years, the 2012 Senate race in Montana promised to be among the most competitive in the nation with huge implications for which party controlled the Senate.

Nothing has changed with three weeks to go. The polls remain close and hardly anyone would be surprised if it takes longer than election night to figure out who won.

In recent weeks the race has become intensely personal, with each candidate trying to prove that he is the real Montanan, while trying to discredit and disqualify the opponent.

For Democratic Sen. Jon Tester, the focus has been his biography, with frequent references to his organic wheat and barley farming on land that has been in his family for more than a century. “They know they can’t beat the farmer from Big Sandy,” he told a cheering crowd recently at the Staggering Ox restaurant in this town straddling the Missouri River.

The challenger, Rep. Dennis Rehberg (R), has been happy to talk about Tester’s Montananess, highlighting the Democrat’s big Wall Street-fueled campaign war chest and a voting record he says aligns Tester with President Obama. Rehberg’s case against the incumbent can be summed up in the sign hanging above his campaign manager’s desk: “He’s a hypocrite, stupid.”

Explore the 2012 Senate map and view unemployment and demographics

The Montana race pits two well-known figures, both elected statewide, and has constantly been cited as one of the three contests that would decide which party controls the Senate. However, with Republican prospects flagging in other key states, Montana has become a last stand for Republicans. Their path to the majority goes through Montana, where a Tester win would make a Democratic majority almost a certainty.

That has led to a flood of advertising from outside interest groups, particularly conservatives, in a sparsely populated state where ads come cheap.

But none of that seems to have changed the fundamentals of the race. When Rehberg announced his challenge 19 months ago, the race was deadlocked. The outside spending and the pendulum swings in the presidential race have changed nothing. The most recent public poll, by Mason-Dixon, gave Rehberg a three-percentage-point lead that was inside the margin of error.

“Honestly, Tester and Rehberg have to feel like they are running a marathon on a treadmill without an iPod: 26 miles of nothing but the same,” said Jennifer Duffy, senior editor for the independent Cook Political Report.

Yet, with so much at stake, the race has not become one of the national partisan standoffs over GOP Medicare reform and Democratic demands for higher taxes on the wealthy.

Instead, the battles are being fought largely on parochial issues, from wolf hunting to who deserves credit for highway construction in a remote southeast corner of the state. The challenger devotes more time in speeches and ads to criticizing Tester’s position on the estate tax — a huge issue in a state where family farming is huge — than he does to Tester’s vote for Obama’s health-care bill. When Rehberg critiques Tester’s votes for the health-care law and the stimulus, he does so by tapping into the state’s long distrust of anything deemed “big” — whether it be big government or big business.

This is fine for Tester, who is trying to run as an independent Democrat who bucked Obama by supporting permits for the Keystone pipeline and by opposing the DREAM Act, which would allow young undocumented immigrants a chance to become legal residents.

Montana is a decidedly GOP state at the presidential level, and Tester faces considerable hurdles as a Democrat, but he is trying to compensate for that by playing up a persona full of Montana mystique. He lost the three middle fingers on his left hand as a child in a meat grinder accident, a detail that has caused GOP operatives no end of trouble as they have repeatedly photo-shopped his head onto other people’s bodies for mailings sent out to conservative voters.

He continues to work his family farm, about 100 miles from the Canadian border, and his massive frame seems a natural fit atop a tractor rather than behind a podium in the Senate. “He’s a real Montanan. He knows how to turn the key on the engine. He knows what it’s like to lose crops to hail,” said Jane Weber, a Democratic member of the Cascade County Commission here.

The Montana-centric focus of the campaign has meant steering clear of almost all big-name national surrogates, but Tester brought his close friend Sen. James Webb (D-Va.) to campaign for him recently.

Tester and Webb were the Democrats who claimed the 50th and 51st Senate seats for their party in the 2006 midterms to give Democrats a majority. Webb told the crowd of meeting Tester at orientation and walking onto the Senate floor for the first time, with Webb in awe and Tester recalling his childhood.

“I get the same feeling that I did in my grandfather’s barn,” Tester told Webb.

Tester is not afraid to throw political punches. His campaign regularly dismisses Rehberg as “Montana’s millionaire congressman” and his early advertising repeatedly hammered Rehberg for voting five times to raise congressional pay.

In the last week Tester and his Democratic allies began running ads questioning Rehberg’s decision in 2010 to file a lawsuit against his hometown fire department in Billings, regarding its handling of wildfires four years ago that damaged property and equipment on land that the congressman intended to develop.

Rehberg said the suit was meant only to set a standard for how future fires would be handled.

Despite the constant questioning of his own background, Rehberg has accepted the personal nature of the campaign. In a personality contest, according to senior advisers, Rehberg will come out ahead if both candidates are ultimately deemed not very likable, because voters will be more comfortable with Rehberg’s more conservative stands.

The latest Mason-Dixon poll showed that 40 percent of voters had a favorable impression of Tester, with 36 percent unfavorable, while 44 percent had a favorable view of Rehberg and 37 percent unfavorable.

Rehberg and his conservative allies have led a sustained attack on Tester, accusing him of voting 95 percent of the time with Obama on key issues.

Back in February only 19 percent of voters guessed that Tester voted at least 90 percent of the time with Obama, according to the challenger’s polling. That number has now grown to more than 50 percent of voters aware of that statistic, and Rehberg’s campaign asserts that it is winning by a 3-to-1 margin among those voters.

The race has worn the patience of some Montanans. Paul Tremper, 17, who cannot vote, told Rehberg that “the campaign has been reduced to sound bites and bullet points, instead of actual issues.”

And at the Staggering Ox, Dan Campbell, 51, a chemist who moved home from Denver to care for his elderly parents, found Tester’s appearance to be wanting as well. Campbell, who is leaning toward voting for Obama and Rehberg, said he wanted more details about how the two parties would work together on real solutions for the economy, and instead Tester “didn’t say a damn thing.”

A vote for Rehberg does not excite Campbell, either. “They’ve been there all these years, decades, and they’re still blaming someone else,” he said.