Jeff Johnson shocked the Minnesota political world Tuesday with a commanding victory in the Republican primary for governor, while U.S. Rep. Tim Walz won a three-way race in the DFL primary, setting up a clash of starkly different visions for the state’s future.

Johnson, a Hennepin County commissioner, derailed former Gov. Tim Pawlenty’s bid to win back his old job. Pawlenty had been widely seen as the front-runner thanks to much higher name recognition from his two previous terms in office, and Johnson overcame a vast fundraising disadvantage with a message of change and by courting supporters of President Donald Trump.

“We have given the government of Minnesota back to the hardworking, forgotten men and women of this state, and you all helped,” Johnson said, gesturing at the jubilant crowd at his primary night party in Plymouth, where he lives.

Walz, who spent 24 years in the National Guard and 20 years as a teacher, celebrated with a raucous crowd of supporters at the Carpenters Union Hall in St. Paul: “I see that beautiful cross-section that is Minnesota and unending possibility that is sitting in this room,” Walz said, his face reddened after pumping fists on his way out to Tom Petty’s “Won’t Back Down.”

Walz, who is from Mankato, promised to use his biography and greater Minnesota ties to form new coalitions that could break through the gridlock that has crippled state government in recent years, on issues like taxes and the opioid epidemic. “If we take the state and bind it together, there’s nothing we can’t do. Nothing we can’t do,” he said.

Walz defeated state Rep. Erin Murphy and Attorney General Lori Swanson, bouncing back after losing the DFL endorsement at the state ­convention in June to an energetic Murphy campaign.

Jeff Johnson greeted his supporters at the watch party at Lucky's 13 Pub in Plymouth after giving his victory speech in the Republican primary for governor on Tuesday.

Based on early returns data, more than 800,000 voters turned out to vote Tuesday, with still more precincts to count — beating recent primary totals.

Voting at Pax Christi Lutheran Church in Eden Prairie, Republican primary voter Robert Kennedy, 82, went for Johnson over Pawlenty.

“I felt that Johnson was more conservative,” Kennedy said. “I like what he stands for.”

In Woodbury, DFL voter Lori Simon, 60, said Walz earned her vote for his position on issues like education and health care. He’s also not a “vulture,” she said, and doesn’t tear down fellow DFL candidates like others in his party.

The stakes of the governor’s race are huge following the eight-year tenure of DFL Gov. Mark Dayton, which saw tax increases and bigger investments in schools and social programs.

The next governor will be in office after the 2020 census, after which new legislative and congressional districts will be drawn. If Johnson wins and Republicans hold on to legislative majorities, Republicans will have full control of state government for the first time in half a century, allowing them to reduce the size and scope of government and weaken the influence of public sector labor unions.

“We have to win in November. We have to win for the people of Minnesota. We have to win so we can let them keep more money in their pocket and leave government out of their daily lives,” Johnson said.

Johnson, 51, won the Republican endorsement at the party’s June convention. Although badly outspent by Pawlenty, Johnson ran a grass-roots campaign that took him around the state in an RV festooned with his image and the slogan, “Overthrow the Status Quo.”

Despite a long career in politics that includes losing soundly to Dayton in 2014, nearly a decade on the Hennepin County Board and a stint in the Legislature, Johnson made the case for change against Pawlenty, who previously served as governor from 2003 to 2011.

Pawlenty’s stunning primary loss brought a likely end to his political career. Asked at his campaign party in Eagan if he was now retired from politics, he responded: “The answer is yes.”

Walz, 54, is a sixth-term congressman from southern Minnesota, and which backed President Donald Trump by 15 percentage points in 2016. He is the ranking Democrat on the House Committee on Veterans Affairs.

He dismissed the outcome on the Republican side: “It didn’t matter who they picked because the divisive message would be the same,” Walz said. He also said he had a message for Johnson: “This teacher stands up to bullies.”

Given the stakes and the candidate résumés, interest groups are expected to flood the November contest with money for advertising — most of it slashing attacks on the opposition.

For months, the political arms of groups like the Minnesota Chamber of Commerce and the Minnesota Business Partnership, which represents the state’s largest corporations, were gearing up to help Pawlenty in hopes of a state government more conducive to business tax cuts and an end to big city progressives’ drive to increase the minimum wage and other benefits.

Johnson will now need to persuade the big donors that he can win in November after his 2014 loss by 110,000 votes in a good Republican year, in what many considered a lackluster campaign.

On the DFL side, labor unions and a few wealthy contributors who traditionally back the DFL are expected to pour money into the race. These DFL activists are especially alarmed at the prospect of Minnesota becoming like nearby states, which have shifted markedly into Republican territory in recent years.

DFL candidate for governor Tim Walz along with his wife, Gwen, greeted supporters Tuesday night after it was announced he had won the primary during a watch party at the Carpenters Union Hall.

Members of the Dokken family drove to the polls at Minnetonka United Methodist Church together split on which gubernatorial candidate to support. When they left the polls, 48-year-old Dan Dokken said he voted for Murphy, while his wife, Kris, and 20-year-old son Kyle chose Walz.

“I think our main goal is to make sure Pawlenty doesn’t get in there,” Dan Dokken, a technology project manager, said.

Johnson took care of that for them.

Denise Kozojed, a 62-year-old saleswoman from Wayzata, said Johnson is “very authentic,” which led him to connect with people across the state.

“I think it says money doesn’t buy votes,” she said. “People who work the crowd like Jeff has makes a difference. People really appreciate that.”

Star Tribune staff writers Stephen Montemayor, Miguel Otárola, Eric Roper and Mukhtar Ibrahim contributed to this report.