WASHINGTON -- Facing an increasingly narrow path to the nomination and failing to thwart Donald Trump's dominance, Sen. Ted Cruz (R-Texas) withdrew from the 2016 presidential race on Tuesday.

"Tonight, I'm sorry to say that path has been foreclosed," Cruz said in a speech Tuesday night in Indianapolis, "but the voters chose another path."

"We are suspending our campaign," he added.

As Trump barreled toward the 1,237 delegates required to win, Cruz's campaign in recent weeks resorted to increasingly desperate measures, mounting a last-ditch effort to win the Indiana primary, one of the only remaining primary states that gave Cruz a chance of winning. But Indiana turned out to be the final nail in the coffin -- Trump won handily in the Hoosier State, including among social conservatives, a demographic that in theory favored Cruz.

To reinvigorate his campaign, Cruz last week named former presidential candidate and Hewlett-Packard CEO Carly Fiorina as his running mate, even though candidates typically do not name their running mate until they have amassed enough delegates for the nomination.

Gerardo Mora via Getty Images Texas Sen. Ted Cruz with his running mate Carly Fiorina.

His campaign also announced a plan to coordinate with the campaign of Ohio Gov. John Kasich, the other remaining candidate. Kasich's team agreed to pull resources out of Indiana and cede the race there to Cruz. However, this effort quickly backfired, when each candidate caused confusion by diminishing its importance. Kasich said voters in Indiana should still vote for him.

Like many of the GOP candidates and party leaders, Cruz underestimated the strength of Trump's appeal. Initially, he often defended Trump instead of attacking him, strategizing that he could pick up Trump’s supporters if the businessman exited the race.

But when it became apparent that Trump's populist and nationalist rhetoric was resonating with Republican voters, with the reality television star dominating the majority of the primaries, Cruz began to target Trump on the debate stage and on the campaign trail -- to little avail.

Once positioned as a strong threat to become the Republican presidential nominee, the Texas senator was the first candidate in either party to officially declare his intent to run for the presidency in 2016. Bypassing the typical first step in a presidential campaign -- the exploratory committee -- he kicked off his campaign in March of 2015 with a rousing speech at Liberty University, the Christian university founded by the Rev. Jerry Falwell.

"What is the promise of America? The idea that -- the revolutionary idea that this country was founded upon, which is that our rights don’t come from man. They come from God Almighty,” he said in his announcement speech.

Tom Williams/CQ Roll Call via Getty Images Sen. Ted Cruz announced his presidential run at Liberty University in March 2015.

A star of the tea party movement, Cruz made social conservatism and religious liberty a fundamental part of his pitch to voters. He highlighted his staunch opposition to gay marriage on the basis of religious freedom, particularly after the Supreme Court decision in June 2015 that legalized gay marriage nationwide. In response, Cruz said he would introduce a constitutional amendment to hold elections for Supreme Court justices.

Over the summer, he held a religious freedom rally in the key state of Iowa, during which he proclaimed that “there is a war on faith in America today, in our lifetime” and bemoaned the “persecution” of Christians.

But despite touting his conservative credentials and fashioning himself as an anti-establishment candidate, Cruz never quite managed to rally conservatives around him.

The Texas senator was hugely unpopular among his colleagues, with most GOP lawmakers reluctant to endorse him until it became clear he was the only viable option to potentially halt Trump's momentum. Only then did Republicans begin backing him, though many gave tepid reasons for doing so and perceived him merely as the lesser of two evils when compared to Trump.

Sen. Lindsey Graham (R-S.C.) announced his support of Cruz just weeks after joking that he wanted to murder him.

Former House Speaker John Boehner (R-Ohio) told students at Stanford University that Cruz was "Lucifer in the flesh" and "a miserable son of a bitch."

Cruz's campaign never had the enthusiasm and fervor of Trump's insurgency. For example, when Cruz introduced himself at the second GOP debate in September, the audience responded with silence.

And while Cruz portrayed himself as an outsider, most voters viewed him as an establishment candidate, compared to the brash, take-no-prisoners Trump.

As the reality of Cruz's downfall and Trump's presumptive nomination begins to sink in, the Republican party faces a serious dilemma: whether to support Trump as the party's nominee and potentially hand Democratic front-runner Hillary Clinton the presidency, or risk further damage to the party with Trump at the helm.

Soon after Cruz's announcement Tuesday, Republican National Committee chairman Reince Priebus urged his party to unite around Trump.

.@realDonaldTrump will be presumptive @GOP nominee, we all need to unite and focus on defeating @HillaryClinton #NeverClinton — Reince Priebus (@Reince) May 4, 2016

But it's unclear if Cruz will now back him. He didn't mention Trump in his speech Tuesday night, and when pressed by NBC's Chuck Todd on Sunday, he repeatedly dodged the question.

“Why can’t you answer the question of whether you can support Donald Trump or not?” Todd asked Cruz.

“But Chuck, Chuck, Chuck,” Cruz interrupted. “Let me finish this point I’m making.”

Ahead of the Indiana primary, Cruz continued to place his bets on a contested convention and tried to make the case that he was the best alternative to stop Trump. But in the end, no one could stop him.

Also on HuffPost:

PHOTO GALLERY Sen. Ted Cruz