Republican Jeff Johnson and Democrat Erin Murphy won their party endorsements Saturday as candidates for Minnesota governor, but both now face tough primary battles against former Gov. Tim Pawlenty and U.S. Rep. Tim Walz.

Republicans meeting in Duluth endorsed Johnson, a Hennepin County commissioner, over two challengers. Pawlenty did not compete for the party nod but earlier said he'd run in the Aug. 14 primary.

Murphy, a state representative from St. Paul, snatched the endorsement from Walz on the strength of a robust campaign built on months of organizing and momentum from recent support by key labor groups. Walz had a small lead on the first ballot, but Murphy overtook him to cross the threshold for endorsement in seven ballots at the DFL convention in Rochester.

"Together we are unstoppable," said Murphy, who has represented parts of St. Paul in the state House since 2007. "It's important that we come together."

But Walz, a U.S. congressman from southern Minnesota, confirmed he'll run in the primary. "We must be able to win in November," Walz told supporters after the party endorsed Murphy.

Johnson immediately pivoted toward the expected fight against Pawlenty. "We have a primary in front of us. We could whine and cry about it, but instead I'd rather just go and win it," Johnson said.

Gallery: Minnesota DFL endorses Erin Murphy for governor Gallery: Minnesota DFL endorses Erin Murphy for governor

Contested primaries for governor present a challenge to both parties as they seek to build unity and momentum heading into a November election that could tilt the balance of political power in St. Paul and Washington.

In addition to the open governor's race, Minnesota has two U.S. Senate races and tossup contests for the first, second, third and eighth congressional seats.

Several thousand party activists gathered at the DFL convention in Rochester and the GOP convention in Duluth to confer party backing on candidates for the statewide races, with the governor's race as the main prize.

While Pawlenty and Walz both present formidable challenges, party endorsements come with financial and organizational backing from the respective state parties. Candidates who run without the endorsement, said DFL Chairman Ken Martin said, "need to know that they're running against the party."

Murphy told reporters after her win that she's "in the position we're in today, earning the endorsement because of a very positive message, a positive message about our future and about what we can do together when we stand together."

Still, an endorsement guarantees little: In 2010, Gov. Mark Dayton won the DFL primary against the endorsed candidate. It's possible additional candidates could join the two primary fields; the filing deadline for the August ballot is Tuesday.

Johnson said his contest with Pawlenty, who was governor from 2003 to 2011, would be a statement about the party's values.

"I believe this primary is about the heart and soul of the Republican Party," said Johnson, who was the Republican candidate for governor in 2014. "Are we controlled by the wealthiest donors? Or is the party controlled by you and the grass-roots activists around the state?"

Pawlenty's campaign did not comment Saturday on Johnson's endorsement or criticism.

The GOP convention left delegates torn about their choices, as Pawlenty's primary bid promised to test the relevance of the long-standing party endorsement process.

Abdi Mohamed, a Woodbury resident, came undecided but was won over by Johnson.

"Not only does he have the support of the endorsement process, he also has a lot of grass-roots support and people who are really voting passionately for him," he said.

He acknowledged the political logic of Pawlenty forgoing the convention.

"I can understand him skipping over the process and going to the primary using that name recognition, but it also leaves a bad taste in your mouth for somebody not working to earn your endorsement," said Mohamed, 24.

While Johnson's endorsement win was expected, the DFL convention grew tense and dramatic as the day wore on. Delegates eliminated state Auditor Rebecca Otto from contention after the third ballot, but a short while later, Walz and Otto walked onto the convention floor together, hands clasped and upraised, as the Beatles' "Come Together" played.

Though Otto never endorsed Walz, they made a mutual plea to end balloting without an endorsement. Walz walked through the hall with both hands in the air and four fingers raised on each, encouraging delegates to vote for option 4 on the ballot: no endorsement. In response, Murphy supporters raised single fingers. Murphy was the first option on the ballot.

Rep. Erin Murphy smiled on stage after it was announced that the other candidates for governor were dropping out of the endorsement process at the DFL State Convention in Rochester on Saturday.

The DFL candidates all sounded Saturday as if they expected to be facing Pawlenty in November.

"This fall, we are going to face Tim Pawlenty in the election," said Murphy, a licensed nurse who once led Minnesota's nurses union. "He's going to bring a message of division into the state of Minnesota because he cannot run on his record."

This, Murphy said, is "no time for a tippy-toe kind of politics. It is time for us to stand up together."

Walz accused Pawlenty of intending to "divide Minnesota." He added, "The spirit of progressive Minnesota is alive and well. We will bring progressive change."

Noting his career as an educator, he said, "This teacher stands up to bullies."

Khalid Omar of Lakeville, a DFL delegate, celebrated Murphy's victory. "She cares for everyone," he said. But Maggie Williams, a DFLer and a state House candidate also from Lakeville, said Walz should continue.

"We need a broader group of people to have their voices heard," she said.

In Duluth, Woodbury Mayor Mary Giuliani Stephens and Naval intelligence officer Phillip Parrish also competed for the endorsement. Woodbury delegate Renee Gebauer, 50, backed Stephens but vowed to be out Sunday campaigning for Johnson. The relatively quick GOP endorsement, she said, "just shows unity in the party."

Republican candidate for governor Jeff Johnson with his running mate Donna Bergstrom at the party's convention in Duluth on Saturday.

Back in Rochester, DFL delegates were thinking about November — and remembering the disappointment of 2016, when Donald Trump nearly won Minnesota on his way to becoming president.

Alternate delegate Jennifer O'Brien, 48, an art director from Edina, called the stakes "huge" and said her concerns are tempered by optimism.

"The 2016 elections were a huge wake-up call for all of us," she said. "We're all gearing up."

Star Tribune staff writers Maya Rao and Jessie Van Berkel contributed to this report.