Visions of two Americas emerged from the 2016 presidential field on Saturday, at the Democratic debate and at Republican campaign events, as the candidates sought to project leadership after the Paris attacks and maneuver for political advantage in a rare moment when national security held voters’ attention.

A dark portrait of a vulnerable homeland — impotent against Islamic State militants, susceptible against undocumented refugees and isolated in a world of fraying alliances — came into sharp relief as several Republicans seized on the crisis to try to elevate terrorism into a defining issue in the 2016 election.

Leading Republicans like Donald J. Trump, Ben Carson and Senator Ted Cruz of Texas called on the Obama administration to halt plans to accept 10,000 Syrian refugees next year. Senator Marco Rubio of Florida, warning that the Islamic State would leverage the Paris attacks to add recruits and raise money, said the United States needed to move immediately to assemble a stronger coalition to fight the militants. And former Gov. Jeb Bush of Florida urged Americans to recognize that “an organized effort to destroy Western civilization” is underway.

The Republicans also broadly agreed that the Paris attacks should be the catalyst for a new military strategy against the Islamic State, also known as ISIS or ISIL, which has claimed responsibility for the carnage on Friday. “This will be coming to America,” Mr. Cruz warned grimly. “ISIS plans to bring these acts of terror to America.”

The Democrats, speaking to a national television audience during their debate in Des Moines, described a far more resilient America — determined to fight terrorism with other countries, dedicated to moral responsibilities like taking in refugees and devoted to diplomacy. But the three candidates quickly parted ways on matters of judgment, as Senator Bernie Sanders of Vermont sought to tie the rise of the Islamic State to Hillary Rodham Clinton’s vote as a senator to authorize the American-led invasion of Iraq in 2003 — an issue that helped doom her previous presidential candidacy in 2008.

“I would argue that the disastrous invasion of Iraq — something that I strongly opposed — has unraveled the region completely and led to the rise of Al Qaeda and to ISIS,” said Mr. Sanders, who barely mentioned the Paris attacks during the debate. “I think that was one of the worst foreign policy blunders in the history of the United States.”

Mrs. Clinton, rather than engage with Mr. Sanders, tried to stay focused on her vision for America by emphasizing diplomacy and drawing contrasts with some of the bellicose talk from Republicans about defeating the Islamic State.

“It cannot be an American fight. And I think what the president has consistently said — which I agree with — is that we will support those who take the fight to ISIS,” Mrs. Clinton said, citing American military support for Kurdish, Iraqi and Arab forces. “But this cannot be an American fight, although American leadership is essential.”

As Mr. Sanders repeatedly put Mrs. Clinton on the defensive, several Republicans also used security concerns to try to gain an edge in a presidential nomination fight that remains wide open and has been relatively lacking in national security debates so far.

Mr. Cruz, Mr. Graham and Gov. John R. Kasich of Ohio went to great lengths to describe elements of their counterterrorism plans in hopes that voters, alarmed and shaken by the terrorist attacks, would prefer experienced leaders at a time of crisis to government outsiders like Mr. Carson and Mr. Trump, who are leading in most public opinion polls.

Speaking to reporters in South Carolina on Saturday, Mr. Cruz used a question about Mr. Carson to turn back to the threat of terrorism and highlight “the need for a strong commander in chief to defeat it and to keep America safe.”

The most striking aspect of the remarks by the Republicans were the ominous tones and foreboding language that emphasized a fortress-America outlook. Even candidates like Mr. Kasich tempered their previous support for accepting more refugees and migrants from Syria and other countries from the Middle East, reflecting fears that extremists would try to slip through any open door.

The toughest language came from Mr. Cruz, who is widely viewed as rising in the Republican field after a pair of well-received debate performances. He argued, for instance, that the United States must be willing to accept civilian deaths in Syria and Iraq in order to defeat the Islamic State through intensified airstrikes.

“It will not be deterred by targeted airstrikes with zero tolerance for civilian casualties, when the terrorists have such utter disregard for innocent life,” Mr. Cruz said on Friday night. On Saturday, in an appearance on “Fox and Friends,” he went on to castigate the president for not being willing, in his view, to go to every length to fight terrorists. “I recognize Barack Obama does not wish to defend this country.”

Mrs. Clinton, for her part, rejected some of the language of the Republicans, refusing to accept their description that America was at war with “radical Islam.”

“I don’t think we’re at war with Islam. I don’t think we’re at war with all Muslims. We’re at war with jihadists,” Mrs. Clinton said during the debate. “I don’t want to be painting with too broad a brush.”

As much as the Republicans were adamant that Mr. Obama had not done enough in the fight against the Islamic State, most of them were still tentative about committing more American ground troops to that effort.

Mr. Rubio, asked in an interview if he would commit 5,000 or even 10,000 troops, said, “I wouldn’t put a number on it,” though he called for “a substantially increased commitment of special operators on the ground.” Mr. Bush said defeating the Islamic State was “the war of our time,” but refused to give a troop estimate. Mr. Cruz said he still believed that Kurdish fighters should lead ground forces.

Their remarks reflected a political reality seen in public opinion polls: A majority of American voters believe the United States should not take the leading role in trying to solve international conflicts, according to a New York Times/CBS News survey released on Thursday. The same poll showed that 72 percent of voters, including 68 percent of Democrats surveyed, believed the American fight against ISIS was going somewhat badly or very badly.

A free-floating sense of danger has led many Republican voters, and their candidates, to strongly support gun ownership as a means of self-protection. At a rally on Saturday in Beaumont, Tex., Mr. Trump said the outcome of the attacks would have been different if people there had been armed.

“You can say what you want, but if they had guns, if our people had guns, if they were allowed to carry, it would have been a much, much different situation,” Mr. Trump said.

Mr. Carson, meanwhile, blamed Mr. Obama for “not having the kind of vision that would allow you to recognize that once you’ve gotten a place like Iraq under control you don’t withdraw, which leaves an incredible vacuum and allows for the development of things like ISIS.”

“I would be working with our allies,” he said, “using every resource known to man, in terms of economic resources, in terms of covert resources, overt resources, military resources, things-that-they-don’t-know-about resources.”

Correction: November 14, 2015

An earlier version of this article misstated where Senator Ted Cruz spoke to reporters on Saturday. He was in South Carolina, not Florida.