Republican presidential candidates Texas Senator Ted Cruz and Kentucky Senator Rand Paul sparred with fellow candidate Florida Senator Marco Rubio on the NSA and immigration during CNN’s prime GOP presidential debate.

Cruz said that the USA Freedom Act, “ended the federal government’s bulk collection of phone medadata of millions of law-abiding citizens. But number two, and the second half of it that is critical, it strengthened the tools of national security and law enforcement to go after terrorists. It gave us greater tools, and we are seeing those tools work right now in San Bernardino. And in particular, what it did, is the prior program only covered a relatively narrow slice of phone calls. When you had a terrorist, you could only search a relatively narrow slice of numbers, primarily landlines. The USA Freedom Act expands that, so now we have cell phones, now we have Internet phones, now we have the phones that terrorists are likely to use, and the focus of law enforcement is on targeting the bad guys. You know, what the Obama administration keeps getting wrong, is whenever anything bad happens they focus on law-abiding citizens, instead of focusing on the bad guys. We need to focus on radical Islamic terrorists, and we need to stop them before they carry out acts of terror.”

Rubio responded that Cruz is wrong, along with others who voted for the act. He added, “This is radical jihadist group that is increasingly sophisticated, and its ability, for example to radicalize American citizens, and its inability to exploit loopholes in our legal immigration system. It’s ability to capture to hold territory in the Middle East, as I outlined earlier, in multiple countries. This is not just the most capable, it is the most sophisticated terror threat we have ever faced. We are now at a time where we need more tools, not less tools. And that tool we lost, the metadata program, was a valuable tool that we no longer have at our disposal.”

Cruz answered, “I would note that Marco knows what he’s what he’s saying isn’t true. You know, Mark Levin wrote a column last week that says that the attack ads his super PAC is running that are saying the same thing, that they are knowingly false, and they are in fact Alinsky-like attacks like Barack Obama. And the reason is simple, what he knows, is that the old program covered 20 to 30% of phone numbers to search for terrorists. The new program covers nearly 100%. That gives us greater ability to stop acts of terrorism, and he knows that that’s the case.”

Rubio countered, “Let me be very careful in answering this, because I don’t think national television, in front of 15 million people is the place to discuss classified information. So, let me just be very clear, there is nothing that we are allowed to do under this bill, that we could not do before. This bill did, however, take away a valuable tool, that allowed the national security agency, and other intelligence agencies to quickly and rapidly access phone records and match them up with other phone records, to see who terrorists have been calling. Because I promise you, the next time there is an attack on this country, the first thing people are going to want to know is, why didn’t we know about it, and why didn’t we stop it? And the answer better not be, because we didn’t have access to records or information that would have allowed us to identify these killers before they attacked.”

Rand then jumped into the debate, stating, “We are not any safer through the bulk collection of all Americans’ records. In fact, I think we’re less safe. we get so distracted by all of the information, we’re not spending enough time getting specific immigration — specific information on terrorists. The other thing is, the one thing that might have stopped San Bernardino, that might have stopped 9/11, would have been stricter controls on those who came here. And Marco has opposed at every point, increased security — border security for those who come to our country. On his Gang of Eight bill, he would have liberalized immigration, but he did not, and he steadfastly opposed, any new border security requirements for refugees or students. Last week, I introduced another bill saying, we need more security. We need more scrutiny. Once again, Marco opposed this. So, Marco can’t have it both ways. He thinks he wants to be this, oh I’m great and strong on national defense, but he’s the weakest of all the candidates on immigration. He is the one for an open border that is leaving us defenseless. If we want to defend the country, we have to defend against [those who are] coming in, and Marco is — has more of an allegiance to [Sen.] Chuck Schumer (D-NY) and to the liberals than he does to conservative policy.”

Rubio responded, “number one, what he’s pointing to is a bill last week — that amendment he voted for that only ten people voted for. You know why? Because it’s not focused on terrorists. It would have banned anyone from coming here. Someone from Taiwan would not have been able to come here as a tourist. Number two, this program — this medadata program, is actually more strict than what a regular law enforcement agency has now. If a regular law enforcement agency wants your phone records, all they have to do is issue a subpoena. But now the intelligence agency is not able to quickly gather records and look at them, to see who these terrorists are calling. And the terrorist that attacked us in San Bernardino, was an American citizen, born and raised in this country, and I bet you, we wish we would have had access to five years of his records, so we could see who he was working with.”

Rand countered, “Marco still misunderstands the immigration issue. What I put forward, was an amendment that would have temporarily halted immigration from high-risk terrorist countries, but it would have started it up, but I want them to go through global entry, which is a program where we do background checks. The thing is is that every terrorist attack we have had since 9/11 has been legal immigration. Marco wants to expand that. I want more rules, more scrutiny, and to defend the country, you have to defend the border.”

Follow Ian Hanchett on Twitter @IanHanchett