Ted Cruz wanted to leave Republican delegates with a case of buyer’s remorse.

The plan was carefully scripted: snub Donald Trump by not endorsing him at the Republican convention on Wednesday night. Unleash a stirring cry for conservative values that would evoke memories of Ronald Reagan’s 1976 clarion call at Gerald Ford’s coronation. That show-stealing speech set Reagan on a glide path to the 1980 nomination, which is what Cruz is hoping for in 2020.

But the plan went awry, and sparked an ugly clash at the GOP convention in Cleveland. As Cruz’s speech dragged past the 20-minute mark with just a perfunctory mention of Trump’s triumph, the crowd grew restive. “Say his name!” some Trump allies shouted. “Go home!” others yelled.

Then the host himself twisted the knife. As Cruz was wrapping up, Trump stepped on his peroration, walking into the arena to join family in his VIP box. The boos for the Texan rang long and loud. Two Trump sources told TIME the outburst was orchestrated by the campaign after they were tipped off that Cruz would withhold the endorsement.

Read More: Watch Ted Cruz Fail to Endorse Donald Trump at the Republican Convention

The speech was a gamble that could upend the 2016 runner-up’s planning for 2020 and shape the contours of a coming party fight should Trump lose. Some RNC officials believe Cruz is actively laying the groundwork for a presidential run in four years regardless of what happens in November. That could set up a remarkable challenge to a sitting President from his own party.

For Cruz, the prime-time address was an all-in wager. Decline to endorse at Trump’s coronation, and Cruz might alienate millions of Republicans at a moment when he is trying to recast himself as a team player. Embrace Trump, and risk tainting a personal brand built on conservative purity. Not to mention help a man who insulted his wife and father.

Most Republicans eyeing future runs for national office have embraced Trump. That’s a product of calculation, not affection: many worry a failure to fall in line could backfire if the outspoken billionaire blames his defeat on their disloyalty. But Cruz has made the case for a year that the GOP loses when it nominates insufficiently conservative candidates. And he’s betting a Trump loss would prove his point.

Before the speech, Cruz’s most-passionate supporters were split on the best course of action. The move wasn’t made lightly; much of the address was crafted by Cruz himself. In the end, it was a bet that kneecapping Trump would help push the party toward a conservative revolution, with the Texan at the head of the column.

Read More: Watch Republican Delegates Boo Ted Cruz

“I want to congratulate Donald Trump on winning the nomination last night,” Cruz began. Of course, Trump had effectively clinched the nomination months earlier. And Cruz never mentioned the man at the top of the ticket again.

The dramatic set piece followed negotiations between the two campaigns and Republican officials, as well as a phone call between the candidates themselves. The speaking slot was one element of an agreement that prevented Cruz’s name from being placed into nomination during the roll call of the states on Tuesday night.

But if Trump’s team expected a graceful concession, the patina of deference was short-lived. In a convention conspicuously light on Trump accolades, the nonendorsement was the sharpest blow yet. It sent an unmistakable message that four months before the 2016 election, the battle for 2020 has already begun.

Weeks ago, in fact. It’s easy to spot the signs across Cleveland: Senator Tom Cotton, the ambitious freshman from Arkansas, stopped in on a breakfast of New Hampshire delegates; Wisconsin Governor Scott Walker, who may be gearing up for another go, hobnobbed with early state activists. Walker must first win re-election, but “he’ll be back” on the national stage, an aide told TIME this week.

Nobody has spent as much time charting his postelection path like Cruz. He dropped out after his defeat in Indiana on May 3, but it was a case of leaving one race to join another. He has continued to spend money. Allies hatched a plan over the next four years to smooth Cruz’s reputation as a solitary climber by parceling out cash to select Republican allies.

Aides closely monitored the snuffed delegate revolts against Trump, ready to pounce if opportunity struck, yet careful to avoid any fingerprints. A brawl over the rules that will govern the next Republican nominating contest was driven by Cruz loyalists. The ham-handed effort, which could have excluded anyone who isn’t a registered Republican from future primaries, was a change expected to benefit the Texas purist if it had passed.

Read More: How Mike Pence Tried to Heal the Republican Rift

Cruz’s close-knit corps of political advisers has never left his side. Some key staff, including strategist David Polyansky and communications hand Catherine Frazier, migrated back to his Senate office. Others landed at a pair of new nonprofit groups that will tend his interests, keep talent in house and prepare for his 2018 Senate re-election. But that is not the ultimate goal.

A second run for the presidency is almost surely in Cruz’s future. “He’s 45 years old,” campaign manager Jeff Roe told reporters on Wednesday. “He came in second.” You can read between the lines.

The only question is when. “I expect Ted Cruz to run no matter what” in 2020, said Carroll Maxwell, a delegate from McKinney, Texas, who was waiting Wednesday afternoon to enter a crowded party Cruz threw at a bar to thank supporters. “That’s what I’d like to see.”

But among his most fervent fans, there was no consensus about how Cruz should handle his speech Wednesday night. Many said he should back an imperfect nominee for the sake of party unity; others were aghast at the idea. “He can’t,” Arizona delegate Gayla Coletto said of a Trump endorsement. “If he does that, he’ll lose 90% of us.”

Gesturing at the lengthy line on a hot afternoon, Jean Griswold, a delegate from Concord, N.C., and a member of Cruz’s Tar Heel State steering committee, tried to explain the ardor fans feel for the Texas Senator. “The people you see here would walk over glass for him,” she said. “As we look to 2020 or 2024, these people here will all be there for him.”

The question after his risky bet on Wednesday night is whether that’s still true.

— With reporting by Zeke J. Miller / Cleveland

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Alex Altman at alex_altman@timemagazine.com.