Chief rivals to U.S. Republican presidential front-runner Donald Trump assailed him for shifting positions on the issues at a debate, but said in the end they would reluctantly support him if he were their party's nominee.

Under questioning by Fox News Channel moderators on Thursday, U.S. Senators Marco Rubio of Florida and Ted Cruz of Texas and Ohio Gov. John Kasich made the promise despite efforts by party elders to build an anti-Trump coalition of Republican voters to pick someone other than the incendiary New York billionaire.

RELATED: Claws out at Republican debate

Hours earlier, 2012 Republican nominee Mitt Romney in a speech blasted Trump, a former reality TV show host, as an unelectable fraud whose nomination would ensure victory for Democratic front-runner Hillary Clinton in the Nov. 8 election to succeed Democratic President Barack Obama.

Tempers escalated quickly at the two-hour debate and, as in previous encounters, the battle descended into schoolyard taunts between Trump, Rubio and Cruz with accusations of lying and even a reference to male genitalia.

While Trump's three rivals followed party dogma, insisting they would set aside their concerns and rally around the ultimate nominee, they said they would do so reluctantly if Trump were to emerge as the candidate for the general election.

"Sometimes he makes it a little bit hard," said Kasich, 63.

Trump, asked if he would support the Republican nominee if it was someone other than him, seemed startled by the question given the momentum behind him, but eventually said, "Yes I will." Trump, 69, defended himself from Romney's blistering rebuke and called Romney a failed candidate.

With the Florida and Ohio primary votes looming on March 15 as make-or-break for the anti-Trump forces, Trump provided some ammunition to his critics.

RELATED: Fight night: Rubio, Cruz gang up on Trump in raucous debate

Trump shrugged when presented with videotaped evidence from the moderators that he had shifted positions on the Iraq war, immigration and whether to admit refugees from the Syrian civil war.

"You have to show a degree of flexibility," he said.

Both Rubio and Cruz pounced.

"I hope we don’t see yoga on this stage," Cruz said. Replied Rubio: "Well, he's very flexible so you never know."

It remained to be seen whether the debate would prove to be damaging to Trump. The runaway front-runner to date has been immune from criticism that other politicians normally face, for instance, over flip-flopping on issues.

While Trump saw the greatest number of overall mentions on social media site Twitter, an analysis showed that 63 percent of the tweets expressing an opinion on him were negative, according to social media analytics firm Brandwatch which separated objective tweets from opinionated tweets in its analysis.

The rating marks a decline in positive sentiment for Trump. In the last two Republican debates, Trump broke even in terms of positive and negative mentions, according to the firm's analysis, while he enjoyed a 62.5 percent positive sentiment rating during the Republican debate before that.

RELATED: On Republican debate day, former nominee Romney to rebuke Trump

Fox News moderator Megyn Kelly, who famously clashed with Trump at the first Republican debate last August, generated a fresh exchange in pressing Trump to explain his involvement with Trump University, a now-defunct online education company that has faced lawsuits from people who feel they paid out money for Trump U and got nothing in return.

"Give me a break," said Trump. "Let's see what happens in court."

Rubio accused Trump of fleecing everyday Americans for personal gain.

"He's trying to do to the American voter what he did to the people who signed up for this course," Rubio said.

The debate went down a negative path early on when Trump responded to Rubio's contention last month that Trump had "small hands."

"Look at these hands," Trump said, flashing his two hands to the crowd. He dismissed any suggestion he might be small elsewhere, saying: "I guarantee you there is no problem."