Updated

The last Republican presidential debate of 2015 turned into a showdown between a surging Texas Sen. Ted Cruz and Florida Sen. Marco Rubio on issues such as immigration, domestic spying and the U.S. military’s role in combating ISIS.

The two senators, who have both seen their stock rise in the polls in recent weeks, arguably had their most tense exchange over the topic of immigration. Rubio pressed Cruz on whether he supported a path for undocumented immigrants to earn citizenship and Cruz compared Rubio’s immigration stance to that of President Barack Obama.

“Some choose to stand with Barack Obama and (New York senator) Chuck Schumer and support amnesty,” Cruz said. “And some stand by (Alabama Senator) Jeff Sessions and (Iowa congressman) Steve King and the American people.”

Rubio's nudging seemed to work -- Cruz went further than he has previously in opposing legalization for people in the U.S. illegally, declaring, "I have never supported legalization and I do not intend to support legalization."

Rubio said that he was open to the idea of allowing undocumented immigrants to obtain green cards after a lengthy process and only if the country can reform border security and the current legal immigration system.

“We know what it takes to do that,” he said.

Rubio was a co-author of comprehensive Senate legislation in 2013 that would have created that pathway, but he has since said the nation's immigration crisis must be addressed in piecemeal fashion.

The two lawmakers also argued about their differences on national security,  with Rubio accusing Cruz of weakening the government's ability to track terrorists because he voted in favor of legislation to eliminate the National Security Agency's bulk phone-records collection program and replace it with a more restrictive effort to keep the records in phone companies' hands.

Cruz, who was touted before the debate as the candidate with the most to gain in Las Vegas, insisted the new law gives the government more access to cellphones and other technology terrorists are more likely to use — a contention Rubio disputed.

"There is nothing we are allowed to do under this bill that we were not allowed to do before," Rubio insisted.

Soon after the Sept. 11, 2001, terror attacks, the NSA began secretly collecting the daily calling records — but not contents of conversations — for most Americans, including people never suspected of any crime.

A new law, called the USA Freedom Act, passed in June with broad, bipartisan support. It ordered the NSA to end bulk collection after a six-month transition that expired last week.

Cruz and Rubio have been sparring from afar over national security for weeks. The Texas senator is on the rise, particularly in Iowa's kickoff caucuses, where he's challenging Trump's months-long lead.

The senators — both Cuban-Americans in their 40s — also clashed over whether the U.S. should seek to remove dictators in the Middle East, including Syrian President Bashar Assad. Cruz argued that the governments that replace autocrats can often be worse than the ones opposed by the U.S., while Rubio said of Middle East dictators, "If they go, I will not shed a tear."

The senators also displayed slight differences in their strategies for targeting the Islamic State. The extremist group claimed responsibility for the Nov. 13 attacks in Paris, and one of the shooters in California pledged allegiance to the group on Facebook shortly before she and her husband shot and killed 14 people at a holiday party.

Cruz called for using "overwhelming air power" to destroy the Islamic State, while Rubio said airstrikes would have to be supplemented by ground troops, including American special operations forces.

President Obama has largely relied on airstrikes to target the militants in Iraq and Syria. However, he's also sent troops to Iraq to help train and assist local forces and recently approved sending special operations forces into Syria.

In what can almost be called an undercard to the heated confrontations between Cruz and Rubio, former Florida Gov. Jeb Bush found his footing in trying to discredit his rival Donald Trump's qualifications for the White House, chiding the brash billionaire for trying to "insult your way to the presidency."

Tuesday night's debate was the first for Republicans since the attacks in Paris and San Bernardino, California, which heightened fears of terrorism in the United States. The attacks have ignited a political debate about President Barack Obama's campaign to defeat the Islamic State in the Middle East and the nation's security posture in preventing attacks in the U.S.

Trump's call for temporarily banning Muslims from the U.S. — a proposal roundly criticized by his rivals — dominated much of the discussion heading into the debate. He said he wasn't seeking to discriminate against Muslims.

"We are not talking about isolation; we're talking about security," he said. "We are not talking about religion, we are talking about security."

Bush dismissed the proposal as unserious, saying "Donald is great at the one-liners, but he's a chaos candidate and he'd be a chaos president."

The Associated Press contributed to this report.

Like us on Facebook
Follow us on Twitter & Instagram