For months, Ted Cruz and Marco Rubio tried to tear each other down in a bid to become Donald Trump‘s top challenger. The senators are now unlikely allies in an effort to stop Trump’s march toward the Republican nomination.

The strategy shift was on full display in Thursday’s GOP debate. Rubio and Cruz ignored each other almost entirely, choosing to instead fully focus their attention on the billionaire businessman whose surprising dominance of the 2016 race has shaken the Republican Party to its core.

Cruz and Rubio’s moves underscore the desperate situation in which they find themselves. A clear path to winning the nomination through the traditional primary process seems increasingly out of reach. Instead, they’re eyeing a deeply complicated, long-shot plan to stop Trump at a contested convention.

It’s a blueprint that probably only works if Rubio and Cruz, along with Ohio Gov. John Kasich, stay in the race, siphoning delegates away from Trump as the primary process weaves its way across the country for months to come.

So when Rubio and Cruz took the stage in Detroit in Thursday, they shelved their well-practiced attacks on each others immigration policies, national security views and campaign tactics.

Instead, Rubio hammered Trump for manufacturing his branded clothing in China and Mexico, not the United States, and challenged the practices of a Trump-branded educational company that’s facing lawsuits. Cruz questioned why the Republican front-runner had donated to Democrats, including Hillary Clinton, and accused him of having “used government power for private gain.”

“Do you understand the principles that made America great in the first place?” Cruz asked Trump, knocking the billionaire’s now-famous campaign slogan.

At several points during the two-hour debate, Trump appeared to be trying to pivot toward the general election, a strategy often employed by a party’s presumptive nominee. He never flinched when asked about his campaign contributions to Clinton, embraced a “softening” of his position on allowing visas for highly skilled overseas workers, and suggested he would be willing to negotiate on his broader immigration policy, as well as on other areas.

“You have to show a degree of flexibility,” Trump said. “If you’re going to be one way and you think it’s wrong, does that mean the rest of your life you have to go in the wrong direction because you don’t think you want to change?”

If Rubio and Cruz succeeded at anything Thursday with their constant barrage of attacks, it was blocking Trump from fully evolving into a more palatable general election candidate. Their needling rattled the first-time candidate, sending him back to his deep reserve of biting personal insults.

He repeatedly belittled “Little Marco” and “Liar Ted.” And in a stunning moment on a presidential debate stage, he rebuffed Rubio’s mocking of his hand size — widely viewed as an insult about his sexual prowess — by declaring, “I guarantee you, there’s no problem” in that area.

The prospect of Trump, with his over-the-top persona and vague, shifting policy positions, winning the nomination has plunged the Republican Party into chaos and sent GOP elites on a desperate search for ways to stop him.

They’re motivated by a belief that Trump would lose a general election to Clinton and hurt down-ballot candidates in competitive races, and a fear that his nomination would split the party so deeply that it could take decades to make it whole again.

After strong showings in the first rounds of primary contests, Trump has claimed 329 delegates, with Cruz capturing 213, Rubio 110, and Kasich 25. The three candidates chasing Trump are now in a fight to keep him from getting the 1,237 delegates needed to secure the nomination.

Cruz did his part by winning his home state of Texas on Super Tuesday. Rubio and Kasich will need to win at home as well when Florida and Ohio vote on March 15.

Under this admittedly challenging scenario, the field would press on through the spring, with all of the candidates picking up delegates, but none reaching the number needed to clinch the nomination. The Republican nominee would then be decided upon at the party convention in Cleveland in July.

The strategizing over a contested convention has been layered with angst-filled discussions among some conservative leaders about whether they could rally around a third-party candidate if Trump does become the nominee.

Rubio and Cruz made clear they wouldn’t join those seeking an alternative option if they can’t stop Trump.

After two hours of pummeling Trump’s character and castigating his readiness to be president, both said unequivocally that they would fall in line behind the businessman and support his candidacy if he becomes the Republican nominee.

Republished with permission of the Associated Press.