Tim Pawlenty stands with his wife, Mary, left, and running mate Michelle Fischbach as he concedes his run for governor Tuesday in Eagan, Minn. (Glen Stubbe/Star Tribune/AP)

Long before Donald Trump was a prominent presidential candidate, Tim Pawlenty outlined a new course for a Republican Party that he believed was too identified with privilege and elitism. The party, he said, needed to be more “Sam’s Club” and less country club. Trump ultimately made good on that idea, and in the end, Pawlenty was taken down by the change.

Pawlenty was the wrong candidate in the wrong year, a misplaced establishment Republican turned Washington lobbyist who tried to shoehorn himself into the party of Trump on what turned out to be a misguided mission. He went down to defeat in what is likely to be the once Minnesota governor’s last run for public office.

Pawlenty’s loss in Tuesday’s gubernatorial primary in Minnesota was one of the most stunning upsets of the 2018 cycle — on a par with the defeat of Democratic Rep. Joseph Crowley (D-N.Y.), who lost to Alexandria Ocasio-Cortez, the phenom who has become a star attraction on the progressive left. Crowley’s fall was a result of neglect and being out of step with a changing House district. Pawlenty was defeated in part by being out of step with the party of Trump.

In the gubernatorial primary, the former two-term governor was the heavy favorite, based on traditional metrics like name identification and money. Instead, he lost decisively to Hennepin County Commissioner Jeff Johnson, who was both more conservative, more tied to the party’s grass roots and seemingly more Trumpian, which appears to count for nearly everything in GOP politics these days.

Pawlenty can be a shrewd analyst of politics. He can size up other candidates and campaigns with common sense and sometimes brutal candor, at least in private. But those instincts are far from perfect. Tactical and strategic missteps proved costly when he ran for the Republican presidential nomination in 2012. In this fraught year for Republicans generally, he made what proved to be another major miscalculation. It cost him not just the party’s nomination but a piece of his legacy after making his mark as governor.

Pawlenty was a member in good standing of the Republican establishment, closely allied with the leadership of the Republican Governors Association, of which he was a former vice chair. When he decided to try for a political comeback this year by seeking his old seat in Minnesota, the RGA officials believed they had the ideal candidate to convert a blue state to red in a year in which they fear some other states — Wisconsin being one, where Gov. Scott Walker (R) looks highly vulnerable — could go the opposite way.

But Pawlenty was not in such good standing with the Minnesota Republican grass roots in this era of Trump. He chose not to compete for the party’s endorsement at the GOP convention in June, claiming that he had not had enough time to work the delegates. He said he would put his efforts into winning the primary. For a former governor, it was a clear acknowledgment that he was no longer in touch with a key part of the party’s base. Maybe it was also a reaction to losing the 2011 Iowa GOP straw poll in his presidential bid, which he later regretted entering but that nonetheless made him the first major casualty of that campaign cycle.

That he was not in good standing among the grass roots was in part due to the fact that he had left Minnesota after his governorship and after his 2012 presidential campaign to become head of the Financial Services Roundtable in Washington. The lucrative lobbying position helped Pawlenty, who was of modest means, build financial security for his family after years in public office. But the decision left him vulnerable to criticism that he was part of the swamp in Washington that Trump had promised to drain.

The more significant problem for Pawlenty as he sought the gubernatorial nomination was that he was miscast in a party that first had shifted to the right in the period after his governorship and now more recently has been taken over by Trump. He was neither the hard-right conservative of what once was a tea party-influenced GOP nor a devotee of Trump, whom he had sharply criticized during the 2016 campaign.

Ironically, Pawlenty can claim the blue-collar roots that the wealthy Trump has come to symbolize in the Republican Party of 2018. His family story is a better representation of a party that has drawn increased support from white working-class voters and that was doing so before Trump came on the scene. His grew up in South St. Paul, then a stockyards community. His father was a truck driver, his mother a homemaker who died when Pawlenty was in his teens.

In style and temperament, Pawlenty is no match for a president who generated so much enthusiasm from many of the kinds of people with whom Pawlenty grew up. He and Trump are at opposite poles. Pawlenty is mild-mannered, polite and not self-obsessed. He once said of himself: “I don’t have celebrity status. I don’t have some comedic shtick. . . . We are not ever going to be the cable TV shooting star of the month.” That came in the summer of 2011, at a time when his biggest worry as a presidential candidate was a fellow Minnesotan, the former congresswoman Michele Bachmann.

As a presidential candidate, Pawlenty’s video commercials were eye-catching — with stirring music and an amped-up audio track featuring Pawlenty urging Americans to do hard things and reminding them of adversities the nation had overcome. On the campaign trail, though he could at times be a full-throated orator, he mostly was a milder-mannered personality. Once as governor he nearly faded from a stage he was sharing with Bachmann and Sarah Palin.

Trump nearly turned Minnesota blue in 2016, losing to Hillary Clinton by fewer than two percentage points. That was a significant improvement for the GOP after Barack Obama had piled up margins of 10 points and eight points in his two campaigns, though George W. Bush had kept the state closer in his two campaigns. Trump converted eight Minnesota counties that had voted for Democratic presidential nominees at least six consecutive times, and in some cases 10, 13, 15 and even 21 times in a row. Whatever Minnesota was when Pawlenty was governor, it had become a different state, particularly inside the Republican Party, by 2018.

Pawlenty’s loss to Johnson will be read as potentially costly to the Republican Party. The Democratic nominee for governor is Rep. Tim Walz, whose southern Minnesota district went for Trump in 2016 and who Democrats believe is well positioned to hold onto the governorship in November. Perhaps that will turn out to be true.

The larger meaning is the obvious one, that Trump has changed the character of the GOP. He has made loyalty, explicitly or implicitly, a litmus test for candidates down the ballot, and candidates in primaries must navigate those politics while trying to keep an eye on the general election electorate.

This left Pawlenty in what proved to be an untenable position. Months after he quit the presidential race in the summer of 2011, Pawlenty concluded that he had run on what he said was ultimately “an outdated model, circa 2002, 2004, where you tried to show some progress early, get the buzz going . . . and then try to pivot off that financially and politically. But things have changed.”

In his comeback campaign, he had the money, the buzz of being a former governor and the support of many establishment Republicans nationally. He was the favorite, plain and simple. Once again, however, things had changed.

“Although the primary results were not what I had hoped, I have no regrets about the run,” he tweeted Wednesday morning, thanking family and his campaign team. But it would be hard to imagine, after all he has been through, that there is not some pang of disappointment about what happened and why.