Donald Trump is in the middle of committing political suicide, leaving many mainstream Republicans to wonder what might have been—if only they had been able to pick a different presidential candidate. Newly leaked emails from Hillary Clinton’s campaign won’t exactly ease that sense of nostalgic regret. They show a Team Hillary that was, at the start of this election cycle, eyeing Florida Sen. Marco Rubio very warily.

In some ways, Rubio reminded Clinton’s staff of her failed 2008 White House run, when she was bested by a younger Democratic politician with an innate appeal to a new generation of voters eager for change in Washington. This time, though, the threat was coming from the Republican Party in the form of Rubio, who at 43 was the youngest candidate in a large field of presidential contenders.

On April 13, 2015, the day Rubio announced his candidacy, a Clinton staffer alerted colleagues to passages of the speech being put out in advance by his Rubio’s campaign—passages that sounded a lot like words spoken by Barack Obama in 2008.

“It’s interesting to compare/contrast with Obama 08,” another staffer wrote. Like Obama, Rubio intended to cast himself as a leader from the vanguard of his party and the voice of a new generation. “Yesterday is over, and we are never going back,” he would say.

The Clinton staffer wondered if this was intended to be a dig at Clinton or Florida Gov. Jeb Bush, himself part of an aging political dynasty.

“Unsure if other parts will be more direct, but…” the first staffer wrote.

In fact, that statement was a direct shot at Clinton, the 67-year old former secretary of state, New York senator, and First Lady, who had announced her second run for the White House a day earlier. “Just yesterday, a leader from yesterday began a campaign for president by promising to take us back to yesterday,” Rubio said when he formally kicked off his campaign in Miami.

The Clinton campaign immediately recognized a threat.

“He gives a good speech, and sounded much more reasonable, populist and accessible than much of the rest of the GOP field,” Christina Reynolds, then a managing director at Glover Park Group, a Clinton-aligned public relations firm, wrote to campaign staff that night. She s now deputy communications director for the Clinton campaign.

“Felt more like an inspiring Democratic speech than a GOP candidate, outside of foreign policy, repealing Obamacare and choice. Lots of references to ‘our generation’ (I.e. Him and younger voters) vs. ‘their generation’ (them being us, Jeb, his opponents, Washington).”

Even two months earlier, a Clinton pollster had been eyeing Rubio as possibly the most serious contender of the emerging Republican slate. “I’m beginning to worry more about Rubio than the others,” Joel Benenson wrote in an email in late February. “He’s playing this very smart—only one who didn’t duck like a chicken shit on the [question] of whether POTUS [Obama] loves America. He has stronger right wing cred than Jeb and he’s finding a way to the middle enough for now and he will be the most exciting choice to Republicans. Could pose a real threat with Latinos etc.”

The email was one of many posted by WikiLeaks, which claims they were hacked from the account of Clinton campaign chairman John Podesta. Neither he nor the Clinton campaign have denied their authenticity.

In one message, a Clinton staffer compared passages of Rubio’s speech to some of Obama’s most soaring rhetoric.

“Each and every time, a new generation has risen up and done what’s needed to be done,” the staffer noted Obama had said in his 2007 speech announcing his own candidacy for president.

Rubio sounded a lot like him: “This election is not just about what laws we will pass. It is a generational choice about what kind of country we will be,” the staffer noted Rubio would say.

The Clinton campaign chose to hold its fire and not interpret Rubio’s promise of change as an assault on Clinton. “Don’t see reason to react here,” campaign communications director Jennifer Palmieri wrote.

“Agreed. Let them take it as an attack on Bush,” wrote Democratic political consultant Mandy Grunwald.

But as the months went on, Clinton’s team saw Rubio as one of the two likely nominees for the Republican Party, alongside Bush, and their concerns about Rubio’s appeal grew.

The Clinton campaign was eager to spar with Rubio on hot-button policy issues. In July, Rubio mocked Clinton in a tweet for wanting to “reset” relations with Cuba, just as she had in her “failed” attempt to forge new diplomatic channels with Russia.

“Here we go,” speechwriter Dan Schwerin wrote his colleagues when he saw the tweet. Campaign staff began a spirited exchange over how to punch back at the upstart senator, who favored keeping a trade embargo born of the Cold War in place against the communist island nation.

“John, did you have in mind having HRC hit back, or campaign?” senior Clinton aide Jake Sullivan asked Podesta.

“I’m good with either. Whatever is faster,” Podesta replied.

The staff crafted Clinton’s response tweet, which was posted later that day: “You've got it backwards: Engagement is a threat to the Castros, not a gift. Embargo hasn’t worked for 50+ years. -H”

The campaign also discussed ways to turn Rubio’s hardline Cuba policy against him. “I think the idea that Rubio is presenting himself as a guy of the future, but hugs this policy rooted in the Cold War, rally [sic] clangs,” Luke Albee, a seasoned Senate aide and then top advisor to the Engage Cuba Coalition, wrote to Podesta. Albee cited polls that showed a majority of voters approved of lifting the embargo and of the Obama administration’s decision to give diplomatic recognition to Cuba, part of an effort to thaw relations between the two nations and open new avenues for trade and tourism.

That Clinton’s team was seizing on signature policy issues to distinguish her from Rubio shows that they were anticipating the possibility of running against him.

In hindsight, parsing positions on Cuba was a quaint warm up for the vicious cage match Clinton finds herself in with the man who ultimately became her rival.

Notably, Donald Trump doesn’t figure prominently in the leaked Podesta emails from earlier in the campaign, when he was just one of 17 candidates and seen by most political professionals as an improbable GOP standard bearer.

Indeed, in October 2015, months after experts had predicted Trump would fade away like some summer fling, the Clinton campaign was still zeroing in on Rubio.

Staff considered whether to emphasize Rubio’s absences from the Senate to imply that he wasn’t doing the job Florida voters sent him to Washington to do. That same month, Bush used the line of attack on his home state rival.

“I’m not demonizing Marco Rubio to point out that he has the worst attendance record in the United States Senate,” Bush told Fox News. “Pursuing your own ambitions at the expense of service of others is wrong.”

Clinton staff also commented on Rubio’s use of a quote attributed to former president Bill Clinton, apparently incorrectly, in order to raise money. The statement actually came from Ed Klein, who’d written in a book attacking Hillary Clinton that her husband wanted to “destroy” Rubio because he posed a threat to her campaign.

Liberals had already dismissed Klein as a gossip columnist with bad sources, and yet the Clinton campaign appeared sensitive to the public appearance that they were sweating Rubio’s rise.

They had their eyes on the wrong rival. Just five months later, in March 2016, Rubio had dropped out and Trump was surging. But the Clinton campaign might have realized this was the best possible outcome.

That month, liberal columnist Brent Budowsky wrote to Podesta that the best thing for Clinton was to run against Trump, who was even less popular nationally than Clinton. She still hadn’t shored up her support among young Democratic voters, as her unexpectedly long and tough primary campaign against Vermont Sen. Bernie Sanders had shown.

“Right now I am petrified that Hillary is almost totally dependent on Republicans nominating Trump,” Budowsky wrote. “[S]he has huge endemic political weaknesses that she would be wise to rectify… even a clown like Ted Cruz would be an even money bet to beat and this scares the hell of out me….”

Updated 10/11/16, 1:30pm to add info from new emails released this morning.