LAS VEGAS — Republicans vowed to greatly escalate a war on terrorism in their first debate since attacks in Paris and California on Tuesday, but clashed over whether to treat all Muslims as suspect and how much to spy on Americans.

The threat of terrorism dominated the often raucous and heated two-hour faceoff of the nine top-polling candidates, reinforcing how much the race has changed since the terror attacks this fall.

“We have people across this country who are scared to death,” said Gov. Chris Christie of New Jersey, on a day when Los Angeles closed its schools out of an abundance of concern after a threat, which turned out to be false.

MAIN TAKEAWAY

The debate revealed the party’s internal debate over national security, divided between the desire to lash out at the Islamic State and concerns over civil liberties that arose in the aftermath of the 2001 terrorist attacks.

Donald Trump remained at center stage, with his repeated vow to ban Muslims from entering the U.S. and call to use Silicon Valley tech experts to help shut down the Internet to terrorists.

Sen. Ted Cruz of Texas, who is emerging as the greatest threat to Trump, disagreed sharply with the Muslim ban, but saved most of his barbs for Sen. Marco Rubio of Florida, who sparred with Cruz repeatedly over national security. Ben Carson, whose standing in polls dropped sharply after the California and Paris attacks raised questions about his foreign policy credentials, was mostly absent in the debate.

MUSLIMS

Several candidates disagreed with Trump’s proposal to bar non-American Muslims from entering the country.

“If we’re going to ban all Muslims, how are we going to get them to be part of a coalition to destroy ISIS?” said former Gov. Jeb Bush of Florida. “This is not a serious proposal,” Bush said. “In fact, it will push the Muslim world, the Arab world away from us at a time when we need to re-engage with them to be able to create a strategy to destroy ISIS.”

“I’m reminded of what FDR’s grandfather said. … ‘All horse-thieves are Democrats, but not all Democrats are horse thieves,’ ” said Cruz. “There are millions of peaceful Muslims across the world, in countries like India, where there is not the problems we are seeing in nations that … have territory controlled by al-Qaida or ISIS. It’s not a war on a faith; it’s a war on a political and theocratic ideology that seeks to murder us.”

Trump defended the ban, saying, “We are not talking about isolation. We’re talking about security. We’re not talking about religion. We’re talking about security.”

SPYING ON AMERICANS

Rubio defended the collection of metadata from U.S. citizens, and lashed out at Cruz for supporting restrictions this year.

Rubio said Cruz supported a bill that took 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.”

Christie also complained about the change, urging the restoration of those “tools to the NSA and to our entire surveillance and law enforcement community.”

Cruz countered that the USA Freedom Act passed this year ended the government’s bulk collection of phone metadata of law-abiding citizens but opened new ways to find terrorists. “The old program covered 20 percent to 30 percent of phone numbers to search for terrorists,” Cruz said. “The new program covers nearly 100 percent. That gives us greater ability to stop acts of terrorism.”