The Republican candidates are in a sour, gloomy mood. At Tuesday night's debate, the contenders promised increasingly extreme responses to ISIS-related terror, draining the evening of all levity. And Donald Trump's persistent lead in the polls this deep into December has the whole field restless. The debate saw Ted Cruz and Rand Paul attacking Marco Rubio, Jeb Bush attacking Trump. The mood of the event was something like this: It's midnight in America.

And if that's the spirit of the moment, it only helps Donald Trump.

Tuesday's Republican debate showed the way ISIS and ISIS-inspired attacks have changed the race for the presidency. When users were asked by Facebook what was the biggest threat facing America, 73 percent of respondents said ISIS. America's role in the Syrian Civil War, how America can regain control of its borders, and our government's attitude toward Muslim travelers and immigrants were all debated with an anxious urgency that veered into desperation and paranoia.

This was deeply unflattering at times. There was Donald Trump's promise to kill innocent family members. There was the moderator Hugh Hewitt's bizarre question to Ben Carson about whether he had the ability to give orders that would kill not just scores, but thousands of innocent children as collateral damage. Carson himself implied that a refusal to fight ISIS in the Levant would mean ISIS may one day fight us in America. Ted Cruz, who had recently implied he would nuke ISIS and see if the sand glows, said he would enact "targeted carpet-bombing," which is rather like calling for a pin-prick bazooka.

Donald Trump has dominated debates in the past by sheer force of his alpha-personality, sniffing at attacks on him, and launching personalized insults against all comers. But at times he distinguished himself in the foreign policy debate on substance.

In an answer touching on the Iraq War, Trump said that the U.S. had wasted untold trillions and suffered thousands of casualties "for nothing." He repeated it, with some emotion in his voice, "What did we get? We got nothing." Candidates have criticized the Iraq War before. President Obama coldly called it a distraction, an error. Ron Paul had denounced it as unjust. But Trump's line is one that will resonate with his supporters: The political class wasted the sacrifices made by ordinary American men in arms. Not just wrong, a betrayal.

Although he got time to fluently explain his foreign policy ideas, the intensified fears over security also likely hurt Marco Rubio. This is not because people find his hawkish foreign policy too ambitious. Instead multiple candidates attacked him as too soft on immigration, soft in a way that endangers American security. Rubio has risen too early, and candidates like Paul and Cruz teamed up to whack him for his support of the Gang of Eight bill, a piece of legislation that would have doubled legal immigration, and did next to nothing to stop the flow of illegal immigration.

Marco Rubio approaches the issue of immigration in his speeches with gobs of sentimentality and empathy for immigrants. But when ISIS is taking advantage of refugee flows from Syria to send fighters back to the West, some percentage of Republican voters will decide that empathy is a luxury American security cannot afford right now.

There were other lively moments.

Notably, Jeb Bush was the only candidate to make an argument against Trump's candidacy. Over and over again, he said that Trump's proposals were eye-catching, but not serious. In a party that talks big about fighting but whose politicians avoid direct confrontation, this looked like bravery, or even foolhardiness. Bush implied that Trump resorted to insults because he wasn't a real leader. "You're not going to be able to insult your way to the presidency," and he deftly added "that's not going to happen." This is exactly the conflict that Bush's donors must be thrilled to see. Yes, our man can stand up to the Reality TV star.

But when Bush tried the same line of criticism later, Trump's response was devastating. It amounted to: You want to see someone leading? Look at me leading you in the polls by 39 points.

Most conservative pundits loved seeing Jeb stand up. They loved the exchanged between Rubio and Cruz. But it still looks like Trump won the debate. All that remains to be seen is whether he can halt the erosion of his support toward Ted Cruz in Iowa.

The sense of threat looming over the race helps Trump. After 9/11, President Bush didn't just promise to fight the terrorists, but to transform the Middle East and implant democracy there. The results have led to disillusionment, which Trump ably reflected in the debate.

The persistence and spread of Islamist terror has put Republicans in a mood to do something nasty. Trump's the man for that job.