Republican front-runners Donald Trump and Ted Cruz faced sharp attacks from their Republican rivals in Tuesday night’s fifth Republican debate, with lower-polling rivals charging that they were not ready to lead the country in an age of terrorism and turmoil in the Middle East.

The debate focused largely on the threat posed by the Islamic State and terrorists who carried out attacks in Paris and San Bernardino, Calif. Lower-polling candidates like Sen. Rand Paul (Ky.), New Jersey Gov. Chris Christie and former Florida governor Jeb Bush used the moment to attack Trump and Cruz and to turn their fierce anti-establishment message against them. How could these candidates govern, they said, if they don’t understand how Washington and the world really work?

“Leadership is not about attacking people, and disparaging people. Leadership is about creating a serious strategy, to deal with the threat of our time,” Bush said to Trump.

Trump, as he had many times before, responded with a reference to Bush’s eroding poll numbers. “Let’s see: I’m at 42 [percent], and you’re at 3, so I’m doing better,” Trump said.

Cruz’s main battle was with Sen. Marco Rubio (Fla.), another Cuban American serving his first term in the Senate. Rubio, who seems to be running behind Cruz, accused the senator from Texas of being weak on terrorism by opposing military spending bills and a measure to increase surveillance. On the question of immigration, Rubio also accused Cruz of agreeing with . . . Rubio, by supporting the offering of legal status to immigrants who are illegally in the country now. “Ted, you support legalizing people who are in this country illegally.”

Cruz scoffed, saying that he had opposed that very thing. He said that comparing him to Rubio was “like suggesting the fireman and the arsonist have the same record, because they were both at the scene of the fire.”

At times, the front-runners seemed to hurt themselves. Asked about America’s nuclear “triad” — the three main delivery methods for nuclear weapons — Trump gave an answer that seemed to indicate little familiarity with the topic. “The power, and the devastation, is very important to me,” Trump said. Cruz, for his part, had an odd talking standoff with CNN moderators Wolf Blitzer and Hugh Hewitt, in which Cruz refused repeated requests to stop talking. Some in the crowd actually booed.

Bush vs. Trump

Earlier, Trump stood by his call to kill the family members of Islamic terrorists, saying that’s the kind of toughness necessary in this fight.

“That will make people think. Because they do not care very much about their lives, but they do care, believe it or not, about their family’s lives,” Trump said, in the midst of a debate dominated by fears about terrorism and security in America.

That brought a rebuke from Bush, who was more aggressive in this debate than he had been in the past.

“The idea that that is a solution to this is just crazy,” Bush said. “It makes no sense to suggest this.”

Trump, as usual, turned a policy argument into a personal one. “He’s a very nice person. But we need tough people,” Trump said.

Bush interrupted. Trump interrupted him.

“Am I talking, or are you talking?

“I’m talking right now,” Bush said. “Little of your own medicine there.” Later, he continued the attack against Trump: “You’re not going to be able to insult your way to the presidency. . . . Leadership is not about attacking people and disparaging people. Leadership is about creating a serious strategy, to deal with the threat of our time.”

Trump also repeated a call to “close” parts of the Internet, apparently in parts of the Middle East, to keep the Islamic State from using the Internet as a recruiting tool. “I don’t want them using our Internet to take our young, impressionable youth,” Trump said.

Later, Trump was also rebuked by Paul, the lowest-polling candidate on the stage. He said that Trump’s ideas for killing family members and shutting down parts of the Internet “would defy every norm that is America,” Paul said. “Whoever you are, that you’re going to support Donald Trump, think, do you believe in the Constitution? Are you going to change the Constitution?”

Trump responded: “So, they can kill us, but we can’t kill them?”

Terrorism, national security dominate debate

Here are highlights from CNN's Republican presidential debate on Dec. 15 in less than two minutes. (Sarah Parnass/The Washington Post)

The main debate — like the “undercard” debate before it — was a powerful signal that, in the wake of the attacks in Paris and San Bernardino, the GOP race has been dominated by concerns about national security.

The gloom in the debate was thorough, and dark. At one point, Trump – the Republican front-runner – looked back at America’s last 12 years of military interventions overseas and declared them worthless.

“We’ve spent 4 trillion dollars trying to topple various people,” Trump said, talking about interventions that began with a fellow Republican’s invasion of Iraq in 2003. “We have done a tremendous disservice to humanity. The people that have been killed. The people that have been wiped away. And for what? It’s not like we had a victory.

“That is exactly what President Obama has said. I’m amazed to hear that from a Republican presidential candidate,” former tech executive Carly Fiorina said.

Trump replied with more gloom. “What do we have now? We have nothing.”

In their opening statements, both Bush and Cruz promised to keep Americans “safe,” suggesting that physical, personal security now overshadowed the other issues in the race. Cruz began his opening statement by saying, “America is at war.”

Those fears colored all the debates that followed. Trump stood by his call to block foreign Muslims from entering the United States, but Bush attacked that idea: “He’s a chaos candidate. And he’d be a chaos president.”

Rubio vs. Cruz

Rubio attacked Cruz for a Senate vote that Rubio said had weakened the government’s capacity to gather personal data. Rubio suggested that another attack was coming, and that Cruz – and others who agreed with him – might be blamed for failing to prevent it.

“I promise you, the next time there is an attack on this country, the first thing people are going to want to know: Why didn’t we know about it? And why didn’t we stop it?” Rubio said.

All of it was a strong, but unwitting, tribute to the political power of terrorism itself. Two attacks, carried out by a relatively small number of people, had consumed a race to lead a vast and complicated country. The candidates onstage seemed to take for granted that Americans were fearful about whether they were safe in everyday life.

“This is not just the most capable — it is the most sophisticated terror threat that we have ever faced,” Rubio said.

At the start of the evening, Paul began with an attack on Trump and Rubio for what he called an overreaction to the terrorist attacks. Rubio, he said, had called for increased government data collection.

“I think they’re both wrong,” Rubio. “I think we defeat terrorism by showing that we do not fear them.”

But that voice of skepticism about terrorism fears was quickly lost when Christie mentioned a bomb scare that shut down Los Angeles’s school system on Tuesday. The threat had been determined to be a hoax, authorities had said a few moments earlier. Christie still used it as evidence that the country was less safe under President Obama.

“America has been betrayed,” Christie said.

Earlier, in the evening’s undercard debate, four low-polling candidates talked almost exclusively about terrorism and the Middle East. All called for more aggressive American measures against the Islamic State. The most notable moment might have been Sen. Lindsey O. Graham (S.C.) declaring “I miss George W. Bush,” as a way of criticizing Obama’s foreign policy.

Undercard debate

Four Republican presidential candidates ranking at the bottom of national polls squared off for their final debate of the year Tuesday night in Las Vegas. Topics focused on national security and the threat from the Islamic State group. (  / AP)

The undercard event likely did little to indicate who will be president in 2017: The highest-polling candidate on the stage was in 10th place overall. But the evening was a powerful, if unwitting, testimony to the power of terrorism itself — a single worry that seemed to block out everything else in the presidential debate.

“We have an enemy that is out to kill us,” said former Arkansas governor Mike Huckabee. “And we have a government we can’t trust anymore.”

All four candidates called for a more forceful American intervention against the Islamic State and Syria. They were willing to accept enormous risks to project American power there: Graham was willing to invade with American ground troops and other allies, and stay indefinitely. Two candidates – former senator Rick Santorum (Pa.) and former New York governor George Pataki – said they were willing to shoot down Russian aircraft in Syria, if those aircraft violated a proposed American no-fly zone. Even though, at the moment, Russia is claiming it also wants to fight the Islamic State, in order to keep Syrian leader Bashar Assad in power.

And at home, Huckabee and Santorum seemed to support greater surveillance of American mosques, with Huckabee suggesting that there would be nothing wrong with government efforts to listen to mosque sermons.

“I hear people act like that there’s something that terrible about going in and listening to sermons in the mosque,” Huckabee said. But, he said, aren’t the mosques open to the public? And don’t Muslims claim to be peaceful? “Shouldn’t they be begging us to go and come and listen to these peaceful sermons.”

The strongest voice in opposition to these statements was Graham himself, the candidate calling most forcefully for an American ground invasion to fight the Islamic State. Graham said repeatedly that, by raising suspicions of Muslims in general, these candidates were helping the Islamic radicals they were intending to hurt.

“ISIL would be dancing in the streets — they just don’t believe in dancing. This is a coup for them,” Graham said, also criticizing calls by front-runner Trump to block Muslims from entering the United States. “Declaring war on their religion only helps ISIL,” he said, using another name for the Islamic State.

Pataki called Russian President Vladimir Putin a bully and questioned Russia’s role in Syria.

“The most important and effective thing you can do to a bully is punch ‘em in the face,” the former New York governor said. Pataki said that if Russian aircraft violate airspace that America has shut off by setting a no-fly zone over Syria, “either us or the Turks should shoot ‘em down, to keep our word.”

Santorum agreed, saying that the consequence of such a shoot-down would not be a full war with Russia, but rather a localized reaction like the one that followed the Turkish government’s recent downing of a Russian jet.

Graham, one of the lowest-polling candidates in this back-of-the-pack debate, attacked Cruz for allegedly supporting Russia and Iran’s policy goal in Syria, the preservation of the regime of Bashar al-Assad. Graham said that backing the brutal Assad would drive more people into the arms of the Islamic State, which opposes him.

“You say, you would keep Assad in power. I will tell you that is the worst possible thing that would come out,” Graham said. He noted that Cruz’s favorite movie is “The Princess Bride,” and followed with some rather forced references to that movie. “Ted, getting in bed with Iran and Russia to save Assad is inconceivable. Princess Buttercup would not like this.”

Earlier, Graham declared “I miss George W. Bush,” adding that President Obama’s weakness overseas had made the world more dangerous for Americans.

“I miss George W. Bush! I wish he were president right now!” Graham said, to applause. “We wouldn’t be in this mess. I’m tired of dictators walking over us.”

Graham called for a broad influx of American ground troops, who would drive out the Islamic State and occupy its territory for an unknown period afterward. Santorum argued that this would play into the Islamic State’s apocalyptic vision, which promises a defeat for enemy armies in a particular Syrian town. Pataki sought a middle ground, saying he wanted to defeat the group on the ground, but not stay long enough to build a democratic state in its place.

“We do not have to occupy,” Pataki said. “We have to destroy ISIS,” he said, using another name for the group.

Huckabee took a coy route, saying he would not actually say how many troops he would deploy to the fight, because it would give valuable information to the enemy. He was also asked: Was it true that Huckabee wanted to defeat the Islamic State in 10 days?

“I sure want them to think we would,” Huckabee said.

Muslims in the U.S.

Earlier Huckabee said the U.S. government should address the threat Islamic extremism poses in the United States. He said intelligence agencies should listen in to sermons in American mosques, to be sure that they are not encouraging violence.

“When people say we can’t go into the mosques, and we can’t listen. That’s utter nonsense. Of course we can,” Huckabee said, noting that churches and mosques were public places where anyone could come in and listen. And, if the mosques don’t allow people in to listen, Huckabee said that could be grounds for more intense surveillance: “Maybe we do need for sure to send somebody in there and gather this intelligence.”

Huckabee’s comments were followed by Santorum, who said that the traditional First Amendment protections for religious groups did not apply to Islam in the same way they applied to other religions.

“Islam is different . . . Islam is not just a religion. It is also a political governing structure,” with its own prescriptions for law, Santorum said. “The idea that that is protected under the First Amendment is wrong. And in fact it is that political structure that is a big problem.”

Those comments drew a response from Graham, who had repeatedly urged those onstage not to denigrate Islam in general while talking about violent Islamic radicals.

“There are at least 3,500 Muslims serving in the American armed forces. Thank you for your service. You are not the enemy. Your religion is not the enemy,” Graham said. He told his rivals: “Leave the faith alone. Go after the radicals that kill us all.”

From the start, the debate had focused almost exclusively on Islam and the fight against violent radicals in Syria, Iraq and the West.

Earlier, Santorum said “World War III” has already begun.

“We have entered World War III. World War III has begun, and we have a leader who refuses to identify it,” said Santorum, meaning America’s global conflict with Islamic militant groups and the threat posed by the government of Iran’s nuclear ambitions.

Huckabee said that Americans were fearful because of incidents like the Dec. 2 terrorist attack that killed 14 people in San Bernardino. “We have an enemy that is out to kill us, and we have a government we can’t trust anymore,” Huckabee said.

But the four low-polling candidates on the stage argued about whether Trump had gone too far in calling for a temporary ban on Muslims entering the United States.

Santorum said that Trump’s argument had been misconstrued: It wasn’t an attack on Muslims; it was an attack on the Obama administration, which had allowed the female shooter in San Bernardino to enter the country despite social-media postings in favor of radical groups.

“Donald Trump’s comments was nothing against Muslim. His comment was against this administration,” Santorum said, to applause. He added that, although not all Muslims are radicals, “All jihadists are Muslims. That’s reality. And we have to stop worrying about offending some people, and start defending all Americans.”

That drew a rebuke from Graham, who said that calls for blocking Muslims played into the Islamic State’s strategy of pitting all Muslims against America. “This is the way to help our enemies. Stop this before it’s too late,” Graham said.

Sean Sullivan, Phillip Rucker, Abby Phillip, Dan Balz and Scott Clement contributed to this report.