Texas Sen. Ted Cruz will say anything to get elected, rival Florida Sen. Marco Rubio said during Thursday's night Republican debate. During the Fox News event, Cruz and Rubio attacked one another over their past positions on immigration. Cruz bashed Rubio’s support of the so-called Gang of Eight bill that would have established a pathway to citizenship for undocumented immigrants in the country, while Rubio said Cruz had been inconsistent on the issue and accused his opponent of pandering to voters.

"The truth is, Ted, throughout this campaign you've been willing to say or do anything in order to get votes," Rubio said.

RTX24HPL Sen. Marco Rubio points at Sen. Ted Cruz during the Fox News debate for the top Republican presidential candidates in Des Moines, Iowa, Thursday, Jan. 28, 2016. Photo: Reuters

During the exchange, Cruz noted that Rubio worked with President Barack Obama and Sen. Chuck Schumer, D-N.Y., on comprehensive immigration reform when he entered the Senate in 2011. Rubio, for his part, pointed out that Cruz previously worked on the campaign of former President George W. Bush — a line of attack that questioned Cruz’s right-wing credentials — and charged that Cruz had advocated for legal status.

“This is the lie that Ted’s campaign has built … that he’s the most conservative guy and everybody else is a RINO,” Republican in name only, Rubio said.

The meat of the argument revolved around whether or not the candidates supported amnesty in 2012 when Rubio pushed for the comprehensive reforms. Rubio has openly shifted his position and now says immigration reforms require step-by-step improvements. Moderators pointed out that Cruz argued for bringing people “out of the shadows” in 2012 — statements he said were not advocating amnesty and were instead intended to bring down Rubio's immigration bill.

“When he ran for election in the state of Florida he told the people, ‘If you elect me I will lead the fight against amnesty,’” Cruz said, attempting to highlight inconsistencies in Rubio's record.

Cruz, long seen as a dark horse in the Republican race, has turned into a force to be reckoned with in the past two months, overtaking Rubio, who has been running third in many polls. Since November, Cruz has seen a dramatic rise in Iowa polls from fourth place with just 12.3 percent of the vote up to a high of 31.8 in early January. He has since dropped to second place with 26.1 percent of the vote, 6.8 points behind businessman Donald Trump in the state. Rubio registers in third place with 13.9 percent.

During that same time, Cruz has also risen in national polls. He currently takes in 19.7 percent of the national vote, 15.6 points behind Trump but in second place. He’s followed next by Rubio, with 10.7, and then retired neurosurgeon Ben Carson, who has 8.3 points. Nobody else tops 5 percent in national polling averages.

During the past two months, the prospect of a Cruz nomination has scared the Republican establishment. Leaders in the party have grown anxious at the prospect that Cruz – who regularly disregards the GOP Senate leadership – or Trump could be their party’s nominee, according to the New York Times. They’ve been pushing their preferred candidates to coalesce around a single candidate who could take on the two firebrands, but to little avail so far. Instead, the candidates seen as most likely to fill that role like Rubio, former Florida Gov. Jeb Bush, New Jersey Gov. Chris Christie and Ohio Gov. John Kasich, have targeted one another and allowed Cruz and Trump to soar.