Republican Jeff Johnson and Democrat Tim Walz are on even financial footing as they enter the homestretch of their contest for governor with about $1 million in cash each, while both political parties have already raised and spent big sums on the battle for control of the Legislature.

Johnson, the surprise winner of the Republican primary against former Gov. Tim Pawlenty, has seen a surge in fundraising for his campaign for governor since late July, raising nearly $1.3 million in the last three months according to new campaign finance filings made public Wednesday.

“Clearly Minnesotans have rallied behind our campaign,” Johnson said in a statement.

Walz, a congressman from the First Congressional District who hopes to succeed two-term DFL Gov. Mark Dayton, also raised $1.3 million in the same period. Walz said in a statement that “Minnesotans from all walks of life are showing up and joining our movement to unite our state.”

What remains to be seen is the role of all-important outside groups, such as corporations, labor unions and wealthy Twin Cities donors — of both conservative and liberal leanings — and where they decide to put their money in one of the most consequential Minnesota elections in years.

While national groups are spending millions on four competitive U.S. House races that could tip control of Congress, the State Capitol has also emerged as a major battleground. Both parties are focused on the race for governor, the Minnesota House and a special election that will determine who controls the Minnesota Senate, which is currently evenly split 33-33.

Both Johnson and Walz face spending caps they agreed to in exchange for taking a public subsidy for their campaigns. Walz cannot exceed about $5 million in spending, while Johnson, having run in a statewide race before, is capped at $4.5 million. Johnson, who did not raise or spend significant funds during his primary race, has more room to spend freely in the homestretch. Walz has already spent $2.7 million. Johnson has spent just shy of $900,000.

Both candidates are also constrained by contribution limits, which are $4,000 to a candidate for governor.

Walz has already received significant help from the Alliance for a Better Minnesota, a Democratic-leaning outside group that spent nearly $1.4 million against Johnson, most of it TV ads hammering him on health care. Johnson says the ads have distorted his position. The question for Johnson is whether business groups will help his bid by forcefully responding to these attacks with their own broadcast assault on Walz.

A recent Star Tribune/MPR News Minnesota Poll found Walz leading Johnson, though some voters were still undecided.

In addition to the race for governor, both parties and their financial backers are focused on the Minnesota House, where the Democratic caucus has raised $2.7 million to date, and is sitting on $1.6 million in cash. Republicans, who need to limit their losses to 10 districts to keep the House majority, have raised $1.3 million and have the same amount in cash.

The state Democratic Party continues to be a fundraising powerhouse, especially compared to Republicans. The DFL has raised nearly $6 million, although $2.2 million came from the House and Senate DFL caucuses. The state party has about $950,000 in cash and another $690,000 in their federal account.

The Republican Party of Minnesota, which for years has been plagued by debt, has a cash balance of $171,108. The party’s federal committee has raised $2.4 million since the beginning of 2017 but has just $67,000 in cash on hand.

State and national labor unions, faced with what they view as an existential crisis if Republicans take control of the state government, are spending heavily to help Democrats. American Federation of State County and Municipal Employees union in Washington, D.C., has given the House DFL caucus $400,000 this year, while the union local has given $160,000. Education Minnesota, the state’s influential teachers union, has given the House DFL $325,000. The Minnesota Nurses Association has given $100,000.

Unlike candidates, political groups can receive and spend unlimited amounts, evidenced by the bevy of six-figure donations.

The WIN Minnesota Political Action Committee, which is the financing arm of the Alliance for a Better Minnesota, reported nearly $3.7 million, including a list of contributors that is a catalog of well-known, wealthy progressives. Alida Messinger, a Rockefeller heir and ex-wife to Dayton, gave $750,000 to the group in August and has contributed more than $1.1 million this year. Jeff Anderson, the attorney representing victims of sexual abuse by priests, gave $50,000. Longtime business maven, attorney and DFL donor Vance Opperman contributed $100,000. Others are less well known: Chani and Steven Laufer of Chevy Chase, Md., have given WIN Minnesota $250,000.

On the Republican side, Mark and Marty Davis gave a combined $75,000 to House Republicans. Their business empire included Sun Country Airlines until recently. Broadcaster Stanley Hubbard gave $50,000. The Minnesota Business Partnership PAC, which represents the state’s largest companies, gave House Republicans $75,000.