By Maeve Reston

CNN

(CNN) — Ted Cruz will bow out of the Republican presidential race Tuesday following a crushing loss to Donald Trump in Indiana, according to a Cruz campaign source, clearing the path for the real estate mogul to clinch the GOP nomination.

It was a remarkable turn of events in a presidential primary race that seemed destined — just weeks ago — to end in a contested convention this summer. Even in the final hours of the race in the Hoosier State, Cruz insisted he was staying in the race until June 7 — going so far as to attack his rival during a news conference as a “pathological liar” unfit for the White House.

#Breaking: Top Cruz campaign source tells @CNN that Cruz will drop out of the race tonight https://t.co/KeEz5u8ImJ pic.twitter.com/gZJ2o5l65B — The Situation Room (@CNNSitRoom) May 4, 2016

In the end, the growing strength of Trump’s candidacy and Cruz’s own stumbles in the past two weeks were too much for Cruz to overcome. The Cruz, Kasich and anti-Trump forces had concocted elaborate plans to try to deprive Trump of the 1,237 delegates he needs to win the nomination outright. But those plans hinged on money and momentum. After Tuesday night, it appeared that Cruz would have neither.

Cruz, a tea party favorite, had hoped to cobble together a winning coalition by consolidating the evangelical and libertarian wings of the Republican Party while also racking up commanding wins in the South. He was ultimately unable to achieve any of those things. Exit polls on Tuesday night showed that Indiana’s evangelical voters split their votes evenly between Trump and Cruz. The Texas senator had the edge among late deciders, who made up a quarter of voters, but it wasn’t enough.

He signaled that he was nearing the end Tuesday during an appearance on Dana Loesch’s radio show, stating that his campaign had “left it all on the field.”

“We are competing to the end as long as we have a viable path to victory,” he said. “We are competing hard in this state and I am hopeful and optimistic. But at this point, it’s in the hands of voters.”

Cruz’s final weeks as a presidential candidate were dominated by awkward moments. He forged an alliance with Ohio Gov. John Kasich that quickly crumbled. He named Carly Fiorina as his running mate, an unusual move for someone who is far from winning the nomination. Indiana Gov. Mike Pence endorsed him — while also offering kind words for Trump.

He was also ridiculed for referring to a basketball hoop as a “ring” and for seemingly failing to notice when Fiorina fell off a stage in front of him.

Still, Cruz outlasted more than a dozen Republican rivals demolished by Trump by adopting an early strategy of playing nice. The Texas Senator had cultivated his image as the ultimate outsider in Washington. He attempted to channel the same frustration against Washington that Trump so successfully harnessed as he avoided becoming one of Trump’s chief targets.

But Cruz’s strategy was predicated on the notion that Trump’s candidacy would ultimately implode — as a result of remarks that went too far or actions that American voters deemed unpresidential.

That never happened.

Supporters of Cruz questioned whether he had waited too long to take on the real estate magnate, as he did in no uncertain terms during his news conference on Tuesday.

In one memorable tweet in mid-December, Cruz noted that “the Establishment” was hoping for “a cage match” between him and Trump. “Sorry to disappoint,” he tweeted, “@realDonaldTrump is terrific.”

When he appeared to inch ahead of Trump in December, Trump turned his fire on Cruz, who was caught flat-footed. He pulled off a win in Iowa, but ultimately lost many of the southern states that were supposed to be his firewall.

When he entered the Senate three years ago, Cruz clearly had presidential ambitions. But few expected him to rise as quickly as he did — particularly as he earned the animosity of party leaders with his uncompromising stances and spotlight-seeking actions.

He began the Republican race by forgoing the usual exploratory committee and instead launching a bid for the White House with little preamble but much fanfare as he stood before thousands of students at Liberty University.

The framing for his candidacy was surprising: Cruz had built his political profile around the government shutdown, not his faith. But the speech signaled a strategy that Cruz pursued over the better part of a year — an effort to become the grass-roots candidate who brings together both evangelical voters and the angry, economically anxious base that had powered Republicans to historic wins in the 2014 midterms.

A cluster of super PACs announced that they had $37 million in commitments to help Cruz, raising the prospect that he could compete with the likes of Jeb Bush, whose super PAC raised more than $100 million last year.

Cruz’s strong organization and deep resources were one of the surprising story lines early in the Republican race. Even if he wasn’t winning much in the way of public support at that point, his critics conceded that he might have the means to compete late into the presidential cycle.

But like everyone else on the GOP side, Cruz ran into Trump.

When Trump began making a series of controversial statements in summer 2015, Cruz was one of the only rivals who refused to rebuke the ascendant GOP frontrunner.

He began rising in national and Iowa polls after several strong debate performances, including one in which he blasted the moderator for encouraging the Republican-on-Republican quarrels that he claimed to deplore.

Trump began to take notice. By December, Trump was questioning Cruz’s position on ethanol policy and the veracity of his faith. By January, Trump unleashed an effective line of attack by questioning Cruz’s eligibility to run for the White House since he was born in Canada to an American mother.

Cruz, at times visibly irritated, began to strike back.

Before the Iowa caucuses, he repeatedly questioned Trump’s conservative credentials — and those attacks seemed to have an effect. Cruz edged out a small win over Trump in the Hawkeye State, and he was seen as having the potential to go the distance.

Cruz then beat expectations in New Hampshire, finishing third, ahead of Bush and Marco Rubio.

But in South Carolina, the state he hoped would be a springboard to other critical Southern contests, Cruz struggled badly — falling to third place and raising questions about the breadth of his appeal.

On the first Super Tuesday contest, Cruz again fell short with evangelicals, raising doubts about whether he could dominate among the group that was so key to his candidacy.

On Tuesday night, he said he was proud of his campaign and his stand for conservative principles. There was no word yet whether he would pledge his support to the presumptive Republican nominee.