Bob Bennett didn’t think the new president was such a bad guy. To be sure, Bennett, a Republican senator from Utah, had a lot of policy differences with Barack Obama, the Democrat who had just won the 2008 election in a landslide. But just because Bennett was a conservative and the president was a liberal didn’t mean they couldn’t find common ground, or share an interest in governing the country he believed they both loved. Bennett had always worked across the aisle, and he didn’t see why that should change.

He was as surprised as anyone by the uprising that followed—and cost him his job. The Tea Party, a mass movement that hadn’t even existed two years earlier, had rallied activists and dealt him a humiliating defeat from within his own party.

Today, a new movement—loosely dubbed “the resistance”—has suddenly arisen in visceral reaction to Donald Trump’s election as president, with thousands taking to the streets. For those who remember the Tea Party, it feels like deja vu.

The parallels are striking: a massive grassroots movement, many of its members new to activism, that feeds primarily off fear and reaction. Misunderstood by the media and both parties, it wreaks havoc on its ostensible allies, even as it reenergizes their moribund political prospects; they can ride the wave, but they cannot control it, and they are often at the mercy of its most unreasonable fringe.

There’s no telling, in these early days, where the anti-Trump resistance will lead. But looking back at the Tea Party may hold a clue to what lies ahead, for both the president and his opponents. It burned hot and, in a few years, burned out, without leaving much in the way of lasting institutions—but not before it had reordered Washington and changed the DNA of the political party in its sights.

“One of the things the activists were upset at my father about was that he was very visible, and looked very happy, during the inauguration,” Bennett’s son Jim, who worked on his last campaign, told me this week. There was an innocent explanation for this: As ranking member of the Senate Rules Committee, it was Bennett’s job to swear in the vice president. He had endorsed and campaigned for Obama’s opponent, John McCain. But “my father looked at the peaceful transfer of power as something that transcended party,” his son recalled.

“The activists said, ‘Why is Senator Bennett up there with Obama looking so happy?’” Jim Bennett added. “He was seen as being complicit.”

Obama and the Democrats had won the 2008 election so convincingly that many were convinced the Republican Party was pretty much over. But then something started happening. Scattered local protests sprung up in January 2009, just days after Obama was inaugurated. Then, in February, the CNBC reporter Rick Santelli’s call for a “Tea Party” gave the movement a viral moment—and a name.

The new administration had announced an executive action that wouldn’t end up affecting very many people, but its critics were convinced it was tantamount to the worst acts of history’s repressive regimes.

That is, Santelli believed the Obama administration’s new housing policy was going to put America on the inevitable road to collectivism. “You know, Cuba used to have mansions and a relatively decent economy,” he warned.

Eight days later, coordinated protests unfolded in 40 cities. Many participants told reporters they’d never been politically active before, but they were alarmed by what was happening in Washington and felt they had to speak out. Fox News covered the protests to a degree that sometimes seemed like cheerleading—one of its hosts, Glenn Beck, was particularly enthusiastic. The administration, in response, singled out the network and accused it of abandoning journalistic values.

Longtime conservative players such as the brothers Charles and David Koch sought to lend support to the new grassroots energy, which they believed could advance their pet causes. Many liberals believed the protests were “Astroturf”: a ginned-up creation of Fox and the Kochs that didn’t reflect real grassroots passion. Critics pointed to racist sentiments expressed by some participants as proof the whole movement was extreme. The Tea Party’s self-appointed leaders insisted they were just regular people who’d been galvanized, and that their chief concern was conservative positions on issues. In particular, like the original Boston Tea Partiers, they were against higher taxes. A backronym, “TEA Party,” was said to stand for “Taxed Enough Already.”

As mad as they were at Obama, the Tea Partiers were really mad at Republicans, who claimed to believe the things they did, but seemed to be just letting the president do whatever he wanted. If the president couldn’t be stopped, they reasoned, it must be because no one was trying hard enough to stop him. Their ostensible allies were selling them out.

And so they turned on people like Bob Bennett: a conservative but a realist, a career politician who saw the value of compromise, a Republican who believed working with Democrats was the way to get things done. Bennett’s approval rating suddenly tanked in his home state. Throughout his career, he’d been rated one of the Senate’s most conservative members, but now his opponents argued he wasn’t conservative enough. One of several Tea Partiers challenging him was a political newcomer named Mike Lee who called himself a “constitutional conservative.”

No senator in Utah’s history had ever failed to advance to the general election. But at the Utah Republican convention in May 2010, Bennett failed to get the 60 percent of delegates he needed to win renomination on the first ballot. In the second round, he finished third. Lee won the nomination, and is still a senator today.

The defeat of a sitting senator by his own party was an astonishing feat. It would repeat itself later that year in Alaska, where Lisa Murkowski lost the GOP primary to another no-name political novice. (She later won the general election as a write-in candidate.) Candidates bearing the Tea Party mantle defeated “establishment” politicians in open primaries across the country for House, Senate, and governor, championed by talk radio and blogs like RedState. To survive, sitting Republican officeholders scrambled to prove their Tea Party bona fides.

For the Obama administration, meanwhile, this was all very puzzling. As a Democratic senator, Obama had gotten along with Republican colleagues like Bennett and Indiana’s Richard Lugar (who would be defeated by a Tea Party primary challenger in 2012). Obama thought of himself as a bridge-builder, and he figured Republicans would continue to support policies they’d advocated in the past—the market-based approach to universal health care championed by the Republican governor of Massachusetts; the cap-and-trade plan to address climate change that Republicans had supported; infrastructure spending that liberal and conservative economists believed was needed to stimulate the economy. But Republicans’ near-total resistance meant Obama could only rely on members of his own party, and couldn’t get much done at all once his party no longer had 60 seats in the Senate.

The mainstream media covered this fight as largely ideological: The Republican Party was moving to the right; conservatives were looking to purge “moderates” from their ranks; “anti-incumbent” rage was in the air. The roots of the Tea Party were said to extend back before Obama was elected, to conservatives’ anger at the Bush administration’s bipartisan bank bailouts, or to the libertarian followers of former Representative Ron Paul.

People like Glenn Beck, Mike Lee, and Ron Paul’s son Rand, who also defeated an establishment-backed candidate to win a Senate seat in 2010, did believe in a conservative ideology of small government and lower taxes. But it was Obama’s election that had brought the masses out into the streets. And they were willing to believe almost anything that confirmed their worst fears about the president: He was a secret Muslim, not born in the U.S., whose fist-bump of greeting was a secret terrorist signal. The rumors raced around online, impervious to debunking.

It’s too soon to tell if the current resistance movement will follow the Tea Party’s pattern. But there are already many parallels. It has arisen spontaneously and en masse. Many Republicans believe it’s not real: The protests, they tell me, are Astroturf funded by George Soros; the opposition to Betsy DeVos as education secretary, which jammed Senate switchboards, was merely manufactured by the teachers’ unions. But the unions and Soros didn’t start this fire any more than the Kochs started the Tea Party—they’re merely riding the wave in hopes it will advance their goals.

Second, Trump’s election appears to have galvanized a lot of people who weren't previously Democratic activists or politically minded at all. They may have voted Democrat, they may consider themselves “progressive,” but they’re not the Democratic base that donated to politicians and knocked on doors in years past. Commentators on the right have seized on the violent sentiments expressed by some participants as proof the whole movement is composed of frightening extremists.

Third, while Trump’s Cabinet, executive actions, and Supreme Court nominee are sharply and traditionally right-wing, he has an agenda his team believes is truly cross-partisan. Senior White House officials say he is serious about pursuing policies Democrats have supported in the past, like negotiating Medicare prescription-drug prices, a big-spending infrastructure bill, and a more protectionist trade policy. Trump’s team sincerely believes at least some Democrats will put governing above partisanship and go along with these initiatives.

But the movement is already urging Democrats to massively resist, and they are listening. Viral rumors that flatter people’s worst assumptions—that Russia hacked the voting machines, that Trump is invading Mexico, that a picture was doctored to make his hands look bigger—catch fire with a credulous audience before they can be debunked (and persist long afterward). Nancy Pelosi and Bernie Sanders, previously considered pretty left-wing, have been attacked for suggesting they could work with Trump. Senate Minority Leader Chuck Schumer drew left-wing protesters at his offices in Brooklyn. When Delaware Senator Tom Carper hugged Trump’s attorney general nominee, Jeff Sessions, after voting against him, anti-Trumpers demanded a primary challenge.

The surge of energy from the Tea Party terrorized Republicans, but it also boosted them. Brian Walsh, a Republican Senate campaign staffer at the time, recalled welcoming the sudden burst of passion. “When the Tea Party first started, I thought it was great,” he told me this week. “We had just lost the White House and a lot of Senate races. It was great to see the grassroots fired up.”

Tea Party primaries were a headache for Walsh’s committee, but when the party did well in the midterms, the primary challenges seemed a small price to pay. “I actually thought on balance the Tea Party movement was a net positive for us,” Walsh said. “Though I think, ultimately, it led to Trump.” (Now a partner in a D.C. consulting firm, Walsh opposed Trump in 2016, in part because the now-president had stiffed his father in a business deal.)

In early 2009, experts predicted Democrats would gain even more Senate seats in 2010 and could not possibly lose the House; Republicans won seven Senate seats and took the House in a wave. Pundits kept saying the Tea Party pushing the GOP to the right would hurt its electoral prospects, but the party gained throughout Obama’s presidency, with the notable exception of the presidential election.

Meanwhile, some liberals perpetually tried to start a parallel left-wing Tea Party movement to purge the Democratic Party of compromisers, but they mostly lost Democratic primaries. Without a president in office who scared the living crap out of rank-and-file voters, the ideologues never had the numbers to prevail.

In retrospect, no one understood what really made Tea Party voters tick better than Donald Trump. He didn’t embrace conservative positions, but as a doubter of the president’s legitimacy, he had no peer, spouting birtherism long after reporters had investigated and debunked it. Conservatives like Mike Lee, Rand Paul, and Glenn Beck watched in horror as he made a mockery of their principles—but the base ate it up. And despite the GOP establishment’s—and mainstream media’s, and Hillary Clinton campaign’s—certainty that general-election voters would reject Trump and punish the GOP, the party swept to unprecedented power at all levels.

As for Bob Bennett, he didn’t live to see the last chapter. He died in May of 2016. On his deathbed, in the hospital, he turned to his wife and son.

“He asked, ‘Are there any Muslims in this hospital?’ We thought it might have been confusion from the stroke,” Jim Bennett recalled. “And then he said, ‘I’d like to go up to every one of them and apologize on behalf of the Republican Party for Donald Trump.’”