As concerns about domestic security come to the fore in the final 50 days of a presidential contest, Hillary Clinton and Donald Trump are voicing two distinct messages for an electorate apparently torn over the choice.

“These attacks were made possible by our extremely open immigration system,” Trump said Monday, after a bomb exploded on a New York City street, injuring more than two dozen people, and a knife-wielding attacker injured others at a mall in Minnesota over the weekend. “Immigration security is national security.”

“I have analyzed the threats…. I know how to do this,” Clinton said Monday morning, underscoring her experience in the Situation Room of the White House and citing national and international leaders with whom she was consulting in the aftermath of bombs discovered or exploded in New York and New Jersey.

In the week before the first nationally-televised presidential debate, a campaign dominated lately by the ricocheted rhetoric of exchanged insults between Clinton and Trump suddenly is rooted in the reality of security threats and fears of terrorism which, until this week, appeared to be mostly foreign matters.

“Whether that will redound, from a political standpoint, they’re both going to huff and puff and say they’re going to get tough on terrorism,’’ says John Mueller, senior fellow at the Cato Institute, senior researcher at Ohio State University and co-author of the book, Chasing Ghosts: The Policing of Terrorism.

“I suppose this will at first be good for Trump,” Mueller says, as “generally speaking, Trump has played the fear card.” As for Clinton, he suggests, “Maybe this will reassure people who will say she’s been there and then done that. On the other hand, this is on her watch at some point, the Democrats’ watch.”

Terrorism ranks second only to the economy in voters’ concerns in the latest ABC News/Washington Poll released at the 15th anniversary of the Sept. 11, 2001, attacks. Voters split fairly evenly in trusting either Clinton or Trump to handle it — 47 percent Clinton, 44 Trump. Yet this marked a narrowing since June, following the mass shooting at a night club in Orlando, when ABC/Post polling found 50 percent calling Clinton best able to handle terrorism, 39 percent Trump.

As the overall contest has narrowed to a dead heat in the latest average of polling monitored by RealClearPolitics — a 0.7-percentage point edge for Clinton — so too has the contest in pivotal swing states that will decide the election.

Trump holds an average 2-point edge over Clinton in Ohio and one point in Florida. In Florida, a New York Times/Siena College survey conducted using an actual voter list shows a 1-point advantage for Clinton. No Republican has won the White House without Ohio, and Florida alone could hand Clinton victory if she is able to hold all the states that have voted Democratic in the last six elections. Yet the 41-40 margin in the Times Florida poll shows how volatile the contest remains in a four-way race, with one in five rejecting the front-runners.

As the nominees take the stage for their first debate Sept. 26, voters appear most eager for solutions for terrorism. While the 90-minute debate will be divided among six topics running 15 minutes apiece, voters have told the Pew Research Center they want at least one period dedicated to the candidates’ plans for keeping the U.S. safe from terrorism. Four in 10 Trump supporters say at least 20 minutes should be devoted to it; nearly one in five Clinton voters say the same.

An Afghan-born naturalized U.S. citizen quickly captured by police was blamed for the bombing in New York’s Chelsea neighborhood and another bomb placed at a race course in New Jersey, after a Somali national was shot and killed by an off-duty police officer following a knife attack at a mall in Minnesota. President Barack Obama said Monday the episodes apparently were unrelated.

“This threat is real, but so is our resolve,” Clinton said Monday, in a hangar press conference in Westchester County, N.Y., proposing an “intelligence surge” to detect and avert such attacks. “Americans will not cower, but we will prevail… We will defeat the evil, twisted ideology of the terrorists.”

“I’m the only candidate in this race who’s been part of the hard decisions to take terrorists off the battlefield,” the former secretary of State said. “I was part of the team that helped the Obama administration develop polices to fight the terrorists… I won’t get into classified information, but I have sat at that table in the Situation Room. I have analyzed the threats… I know how to do this.”

“We have to be tough and we have to be strong.” Trump said at an afternoon rally in Fort Myers, Florida. “Hillary Clinton is a weak and ineffective person, and if you choose Donald Trump, these problems are going to go away far quicker than anyone would believe.”

Trump, Clinton maintains, has not only instilled fear, but also encouraged the enemy with anti-Muslim rhetoric.

“We know that a lot of the rhetoric that we’ve heard from Donald Trump has been seized on by terrorists, in particular by ISIS. They are seeking to make this a war against Islam — We know that Donald Trump’s comments have been used online for recruitment by terrorists,” Clinton said. “We’re going to go after the bad guys and we’re going to get them, but we’re not going to go after an entire religion.’’

Clinton maintained that Michael Hayden, a former CIA director for President George W. Bush supporting Clinton’s candidacy, has called Trump “a recruiting sergeant” for ISIS. Actually, Hayden has said Trump is making Americans “less safe” with rhetoric that benefits ISIS in portraying the U.S. as anti-Islam. Asked by Al Jazeera if this makes Trump a “recruiting sergeant” for ISIS, Hayden replied, “Yes.”

Clinton “said today that it’s my strong opposition to these people that’s a recruiting tool,” Trump told his Florida audience. “Let me just tell you, she is not the right person to solve a problem that largely her and Obama gave us. It disqualifies her from being a credible presidential candidate.”

“In fact, Hillary Clinton talks tougher about my supporters than she does Islamic terrorism,” Trump said, citing Clinton’s partially rescinded, recent remark about “half” of his campaign supporters. “She calls the patriotic Americans who support our campaign… deplorable and irredeemable… Has she ever talked that way about radical Islamists? No.”

“My opponent has the most open borders policy of anyone to ever seek the presidency,” Trump said. “As secretary of state, she allowed thousands of criminal aliens to be released into our country.”

Discounting the threat that refugees pose, Clinton said: “Let us remember that there are millions and millions of naturalized citizens in America from all over the world,” including law-abiding Muslim-Americans. “I am absolutely in favor and have long been an advocate for tough vetting,” she said — but “let’s remember what happened on 9/11” — the attackers were not refugees, but here on visas.

Bob Gates, a former secretary of defense for both Obama and Bush, has offered flattering words for neither Clinton nor Trump in their visions for national security. Yet Gates was particularly critical of Trump in a recent Wall Street Journal essay — calling him “unqualified and unfit to be commander-in-chief.”

“He disdains expertise and experience while touting his own—such as his claim that he knows more about ISIS than America’s generals,’’ Gates wrote. “He has declared our senior military leaders ‘reduced to rubble’ and ‘embarrassing our country’ and has suggested that, if elected, he will purge them—an unprecedented and unconscionable threat.”

Trump responded on Twitter by denouncing Gates as “dopey.”

In her own campaign ads, Clinton ridicules Trump’s comment that: “I know more about ISIS than the generals.” And on Monday, she noted Trump’s assertion of a “secret plan” for destroying ISIS — promising to demand a battle plan from his generals within 30 days after entering office.

“We have opened the world to ISIS, and now we have to close those doors,” Trump said Monday. “It is the job of a responsible government to allow only those who will succeed and flourish here… They have to love our country.”

“Certainly terrorism is a big deal and people are particularly concerned about ISIS,” says Mueller, citing a poll for Investor’s Business Daily that found 77 percent of Americans calling ISIS “a serious threat to the existence or survival of the U.S” after the attacks at the Brussels airport that killed 32 civilians.

“I consider that complete nonsense personally,” Mueller says. “The military is actually doing an extremely good job now in the Middle East… ISIS is being smoked out. The number of recruits is off by 90 percent.”

Yet touting any successes in combatting terrorism carries its own risk.

Clinton “hasn’t talked about how good the policy is working,” Mueller says of the fight against ISIS, pointing then to the most recent domestic threats. “It proves that you’re wrong, because one nutcase in New Jersey can set off a pressure-cooker bomb. If anything happens anywhere, it proves you wrong.”