July 21, 2016 3:51 PM EDT

It was hard to imagine a more ignominious ending to his 2016 campaign. Standing before the party he had plotted for years to take over, Texas Sen. Ted Cruz stood for 38 seconds as the convention hall booed and jeered his announcement that Republicans should “vote their conscience” this fall, a faintly coded declaration that he did not support nominee Donald Trump.

At several points in the previous year, Cruz and his allies had appeared to be in striking distance of their goal, to purify and remake the Republican Party as an ideological force. But the arrival of Trump and a series of missteps took from the conservative rebels even the consolation prize of further remaking party rules to make a takeover more likely in 2020. The party had turned against him.

The party stalwart’s long struggle against Trump gave way to begrudging support. In the wake of that acceptance emerged an epic struggle by “Never Trump” Republicans and conservative purists to overturn the will of voters and a parallel effort to prevent the hijacking of the party by a Trump-like candidate again.

After months of intra-party rancor and weeks of behind-the-scenes meetings, the rebels had little to show for it. And the outcome of the battle may portend trouble for the incongruous forces behind them: a coterie of self-described conservative grassroots activists with the blessing, if not the outright support, of Cruz.

The short answer to why the movement failed is that it was never that powerful to begin with. But that glib response ignores the very real threats the RNC and Trump campaign perceived to Trump’s nomination, and the months of intrigue and lobbying they launched to curtail them. The fight became a proxy for the GOP’s competing forces of party unity, conservative purity and populist anger.

The seeds of the anti-Trump push were planted the night of the South Carolina primary, when Cruz aides watched the first crack emerge in their candidate’s Southern firewall. For years, the Texas Senator and his top aides had developed what they thought was an easy path to sewing up the nomination: encourage Southern, more conservative states to move their primaries forward in the calendar to create a “conservative” Super Tuesday that was tailor-made for someone like Cruz.

Read More: How Some Convention Speakers Avoided Endorsing Trump

South Carolina was a bellwether, and Cruz aides saw a potential disaster. Trump handily won all of the state’s delegates, as Cruz was shut out even in the most conservative congressional districts. His aides quickly parroted an explanation, or at least found a scapegoat: the Palmetto State’s open primary allowed Democrats and independents to vote in the GOP primary. Conservatives were being usurped from within.

It was a narrative they continued to press as Cruz went on to lose most of the Southern states on March 1, and with it essentially all of his momentum, even as the race narrowed to just a handful of candidates. His team shifted gears, believing their only hope was to force a contested convention by keeping Trump below the 1,237 delegates required to win the GOP nomination.

“It was the only way,” explained a top Cruz aide. They found common cause, though not support, from several outside Republican groups that sprouted to do what they could to keep Trump from taking over the party. The campaign’s delegate tracking and legal teams drastically scaled up to fight for every delegate and slot on the critical convention rules committee.

The national party was initially supportive of the contested convention efforts, with RNC Chairman Reince Priebus telling allies at one point in mid-April he expected it to happen. Teams of lawyers scrubbed the party rules for loopholes and exploitations to best position their preferred candidates. At the RNC Spring Meeting at a beachside resort in Hollywood, Florida, Priebus wrangled the national committee’s standing committee on rules to vote down any effort to strengthen Trump’s position going into the Cleveland convention.

But voters had other ideas, flocking to Trump’s bombastic rhetoric and tell-it-like-it-is style. When Cruz dropped out on May 3 after losing the Indiana primary, Priebus wasted no time before endorsing, bringing about one of the most unlikely coalitions in modern politics. Immediately he directed his aides to head off any lingering efforts to divide the party, even as top Republicans slow-walked their embrace of the presumptive nominee.

Cruz’s team never truly gave up. Diehard supporters still looked to overthrow Trump and replace him with Cruz at the party convention. A maze of outside groups sprang up seeking to allow delegates to dump Trump, with names like Delegates Unbound and Free the Delegates. Some relied on a rejected interpretation of party rules that maintained that delegates could never be required to vote for a candidate. Most accepted that a change to the party rules would be required in Cleveland, and set out to rally and lobby the committee members to their cause.

At the same time, loyalist aides, seeing only pyrrhic victory in stopping Trump at the convention, contemplated how best to position Cruz for success in 2020. Many Republicans believe he is almost certain to run again, whether or not Trump is elected in November, and to lay the groundwork Cruz’s team wanted a range of reforms to the Republican National Committee and how the GOP picks its nominees. Cruz’s high command were told to keep their powder dry for the next campaign, as some entered his Senate office or launched outside groups to support him for a reboot.

Enter Ken Cuccinelli, the former Virginia Attorney General and president of the Senate Conservatives Fund, the purist group that was an early backer of Cruz and Utah Sen. Mike Lee. Cuccinelli served as a key advisor on the Cruz campaign on delegate selection, and weeks before the convention he approached RNC Chairman Reince Priebus seeking to broker an agreement to prevent chaos in Cleveland. At the same time, RNC officials read reports on the Free the Delegates movement claiming they would win a majority of the rules committee to their effort, or at least a strong minority—25%—required to bring such a vote to the full convention. Those numbers never tracked with the RNC’s internal headcount, but Priebus and Trump weren’t leaving anything to chance.

Priebus dispatched his top two aides, RNC Chief of Staff Katie Walsh and COO Sean Cairncross to take Cuccinelli up on the negotiations, which also included Trump counsel Bill McGinley. They met and spoke for more than a week before the rules committee gaveled into session last Thursday. According to sources on both sides of the negotiation, the talks centered on the party reforms for 2020, rather than the dump Trump efforts.

Early talks weren’t fruitful. And as the Rules Committee gathered, it opened with discord. A Cuccinelli ally on the rules committee opened with an amendment to ban lobbyists from serving on the RNC, which would have disqualified several prominent members and Priebus allies. Immediately, chair Enid Mickelson declared a printer jam required delaying the proceedings. Another round of secret talks began.

First on Cuccinelli’s list of demands was a 20% delegate bonus for states with closed primaries, increasing the power of those states. He also wanted the first four primary and caucuses, known as the carve-out states, to be closed to just Republicans. He also wanted to change terms of RNC membership. Currently national committee-men and -women are elected in convention years and serve from the end of one convention to the end of the next.

Cuccinelli wanted them to be able to vote at the start of the convention, and adjust their terms earlier—a move that would make them less like superdelegates. He also wanted a committee to study reforming the entire nominating process—and control who served on it.

The RNC countered with a closed primary bonus of 15%, but only for the smaller component of a state’s at-large delegation. Party leaders were willing to allow Cuccinelli to name four of the proposed 13 members of the study committee. And there would be no talk of unbinding delegates.

“He said he couldn’t do it,” a senior RNC official said of Cuccinelli, noting that many of the proposals would have required a significant “lift” on the RNC’s part to sell to members whose interests would have be maligned. “It wasn’t a sticking point for us, it was a sticking point for them,” said the RNC official, saying they had confidence they could bring enough votes along.

As the deadline for an agreement slipped, Cuccinelli huddled in a separate room with his loose coalition of allies, including conservative lawyer Jim Bopp, Virginia national committeeman Morton Blackwell, Free the Delegates leader Kendal Unruh and others.

Unruh, in particular, couldn’t agree to the deal, which would have ended any chance of removing Trump and meaning her months-long effort would have been for naught. As the committee convened at 1 p.m., RNC officials rejected a last minute plea to go back to the negotiating table. They wanted to see just how strong Cuccinelli’s coalition was.

The first test vote was on an amendment to overturn the RNC’s ability to change the party rules between conventions—sometime put in place at the 2012 convention, and used in the intervening period to reverse some of the more controversial rules provisions inserted by Mitt Romney’s campaign four years ago. After it failed by a 23-86 vote, below the 28 required for a minority report, RNC members knew they didn’t need to talk, so they allowed Cuccinelli’s frustrated allies to put forward amendment after amendment, and rejected them by similar margin.

At one point an anti-Trump rules committee member approached New Hampshire Committeeman and Priebus ally Steve Duprey jokingly about getting his support to change a comma to a semicolon. “Not today,” he replied with a smile. The rebellion wouldn’t just be defeated, it would be crushed.

The Trump campaign, which was instrumental with the RNC in voting down the proposals, was gleeful, with the campaign chairman quickly taking to Twitter to tout their anti-Trump defeat. Essentially none of Cuccinelli’s proposals were adopted, other than the study committee to review the nominating process, except now the committee would be made up of eight RNC members, with a chair appointed by the RNC Chair and no outside influence.

But privately, party officials still feared a minority report or another procedural move, which would have forced a roll call vote of the convention if majorities of 7 delegations called for one. Over the long weekend both sides looked for any defections.

By Monday, the RNC knew they had the votes, but facing the prospect of a messy show on the floor, RNC officials offered yet another deal. They would reopen the party rules in the usually pro forma Monday session to add a 10% bonus for at-large delegates for states with closed primaries and fix a provision about convention committee confidentiality.

In exchange, Cuccinelli would have to bring on Utah Sen. Mike Lee, the Cruz ally and one of the most vocal Never Trump delegates, who was pushing to vote down the rules package to endorse the agreement. Cuccinelli said he couldn’t deliver Lee. “We’re not dealing with someone who can actually deliver a whole coalition,” RNC officials said.

On the convention floor, senior RNC officials cajoled anti-Trump delegates from the D.C. delegation to withdraw their signatures, arguing that reopening the rules would only benefit Cruz—who is just as anathema to them as Trump. To pro-Trump delegates who were swayed by the RNC reform proposals, they argued that it would be an embarrassment for their nominee.

Most party insiders already opposed the measure, believing that even if they dislike Trump they needed to respect the will of voters. They convinced enough delegates to withdraw their names to avoid the roll call. Despite a few messy minutes of chaos, they avoided a messy and difficult-to-control vote.

On Tuesday, hours before Donald Trump formally was awarded the Republican nomination, top Republican National Committee officials mounted a behind-the-scenes effort to avoid one final protest by delegates opposed to the bombastic billionaire. Party rules allowed any candidate who won the support of a majority of the delegates in eight states to be entered into nomination, which would have allowed for speeches in favor of Texas Sen. Ted Cruz, who seemingly had the requisite support. Avoiding that was a condition of Cruz’s invitation to speak to delegates at the convention, but some of his supporters seemingly had ideas of their own. Party staffers sprung into action, pulling wavering delegates aside on the floor and by phone and.

In the end, both sides left the experience with bad feelings for the other, setting the stage for more messy fights over the coming years, whether Trump wins or loses. “I think the elected delegates are the grassroots,” said another senior RNC official, mocking the monikers adopted by Cuccinelli and Cruz. “If you can’t even get 25%, you’re not speaking for the grassroots.”

The fragile alliance between the GOP’s populists and establishment succeeded as temporary brace against the purity wing, but it has an expiration date. Pragmatists within the party who have embraced Trump for the sake of keeping the party together are already looking around for a more palatable response to Trump should he lose in November.

As for the Cruz coalition, which at so many points in the campaign appeared ascendant within the party, ended the nominating process clearly weakened and ostracized. The candidate who successfully navigated the populist and conservative wings to topple a better-funded Establishment candidate in 2012 had lost his footing. Cruz found himself on the defensive even from his own state’s delegates Thursday. Party leaders who had hoped to forge some unity in Cleveland watched—and in the privacy of their luxury skyboxes, some joined—as Cruz was booed off stage. Cruz was denied entry to Sheldon Adelson’s suite, as the billionaire megadonor and his wife posed for a picture tweeted by an aide with “with their choice for president,” Trump.

On CNN Thursday, RNC Senior Strategist and Communications Director Sean Spicer was asked about New York Rep. Pete King calling Cruz an a–hole. “I’d probably use the same verbiage,” Spicer said.

Contact us at letters@time.com.

Read More From TIME

Related Stories

EDIT POST