Minnesota voters will head to the polls on Tuesday in a high-stakes primary that will shape this year's fight for control of the Legislature and winnow the field for Congress.

With pockets of deep division around the state, roughly a half-million likely voters will sort out 40 legislative and eight congressional primaries. In many legislative districts, the winner of the primary is expected to win in November, making Tuesday a must-win in many of the hardest fought races. In others, victorious primary contestants will face equally tough fights against opposite-party rivals over the next few months.

"We may have some very close races," said Secretary of State Mark Ritchie, who is preparing for the possibility of a recount or two.

Candidates are facing mountains of uncertainty, and some are finding party endorsements offer no guarantee of victory.

The DFL party has pumped more than $155,000 into Rick Nolan's candidacy in the Eighth Congressional District, where a primary victory is far from certain.

The GOP is still struggling with deep debt and anemic fundraising. The party has supported its legislative picks, but it has done so largely with e-mails and phone calls -- not money.

"Certainly, they have been helpful," said Dave Osmek, a Republican-endorsed Senate candidate. "It would be better if they weren't bankrupt,"

Legislative pickings

Osmek is vying in one of three primaries in the western Twin Cities suburbs where the challenger is campaigning as a more conservative alternative to a sitting GOP legislator. He faces Republican state Rep. Connie Doepke of Orono.

Senate Deputy Majority Leader Julianne Ortman is facing a challenge from Bruce Schwitchtenberg.

Longtime Republican Rep. Steve Smith is in a tough primary against Tea Party activist Cindy Pugh, who nabbed the GOP endorsement.

The Democratic legislative races have their drama, as well.

Virginia Democrats in the Iron Range will choose among three vying to replace retiring Rep. Tom Rukavina, while Pine City-area Democrats will decide whether to pick former Rep. Tim Faust or Nathan Johnson to run in a contested open seat.

In the Willmar area, DFL state Sen. Lyle Koenen, who won the seat in a special election this year to replace the late Gary Kubly, will face Larry Rice. Rice ran against Republican state Sen. Joe Gimse in 2010, but a rejiggering of legislative boundaries put Koenen and Gimse in the same district for the 2012 election.

Congressional contests

The Republican race between Allen Quist and Mike Parry in southern Minnesota's First District has proven the most combustible. It started with an into-the-night endorsing convention that deadlocked. Since then, Parry has dug up Quist's off-beat history, including his visit to a gay porn shop to investigate health issues. Quist has accused Parry of being a bad businessman who doesn't believe in his ability to win. Parry added to the heat recently by accusing DFL Gov. Mark Dayton of pill-popping, which the governor and high-powered Republicans dismissed as untrue.

The DFL race in Minnesota's northern Eighth Congressional District, which will determine who gets a shot at unseating freshman Republican Rep. Chip Cravaack, is capturing big bucks from outside groups. Cravaack will either face former Duluth City Councilman Jeff Anderson, former state Sen. Tarryl Clark or former U.S. Rep. Rick Nolan.

Democratic U.S. Rep. Keith Ellison and U.S. Rep. Michele Bachmann face quirky challengers in their own parties who are not expected to threaten.

Meanwhile, Democratic U.S. Sen. Amy Klobuchar has three challengers, and Kurt Bills, the Republican Senate candidate, faces two, including veteran David Carlson, who has run some feisty cable television ads.

Rachel E. Stassen-Berger • Twitter: @rachelsb