As the war against ISIS in Iraq and Syria flails, Republican congressional candidates and political action groups are spending at breakneck speeds to attach the calamity to Democratic incumbents in vulnerable seats, and the worse it gets overseas, the worse it gets for those Democrats.

Less than a month before Election Day, national security and foreign policy has emerged as a top-tier campaign issue for the first time in several years. In a Gallup poll released Monday, 78 percent of respondents said “the situation with Islamic militants in Iraq and Syria” was extremely or very important to their vote. That’s higher than the number of voters who are focused on the budget deficit, equal pay for women, immigration, and Obamacare, just behind jobs and the economy. The poll also showed Republicans with a 19 percent advantage over Democrats on ISIS and a 13 percent advantage on foreign affairs in general. In Gallup’s April survey, foreign affairs ranked low on the voters’ list of priorities and ISIS wasn’t even on the questionnaire.

In recent weeks, GOP campaigns and outside groups, looking for any voter trend to capitalize on in the homestretch, have seized on Democratic incumbents’ records on foreign policy and their past support for Obama administration policies. On Tuesday, the National Republican Senatorial Committee released a series of ads in four close Senate races focused on the president’s perceived foreign-policy failures.

“Big money is going toward foreign policy, people are investing in it. Jobs and the economy will always be No. 1, but this has popped from issue maybe 5 or 6 to maybe 2 or 3,” said Joe Pounder, president of America Rising LLC, which works with several GOP campaigns. “ISIS is just one of the things leading to a crisis mentality among voters. And when you don’t have much new in the way of the economy going on, this is the new issue.”

While the campaigns had been doing much of the spending on their own, big super PACs and issue advocacy organizations are now joining the fight, spending millions on new national-security-related ads, according to public disclosures. The groups now increasing their investments in national-security-related ads include Crossroads GPS, the Ending Spending Action Fund, the Koch brothers-backed Concerned Veterans for America, and many others.

Their strategy is twofold: to paint the Obama administration and its supporters in Congress as failed stewards of foreign policy who have put the country at greater risk, and to call into question the competence and consistency of incumbent Democrats with incomplete or incoherent messages on the crises in Iraq and Syria.

A Sept. 30 NRSC ad attacks Colorado Sen. Mark Udall for saying, “ISIS does not present an imminent threat to our nation.” (He later walked back that comment.) The NRSC’s Oct. 13 ad on Udall alleges that he missed over 60 percent of Senate Armed Services Committee meetings.

Udall’s Oct. 14 response ad on national security does not address ISIS but focuses on the senator’s criticism of the CIA and NSA for domestic surveillance. Polls show a very close race, with Udall slightly trailing Republican Cory Gardner.

A new NRSC ad released Tuesday criticizes Iowa Rep. and Senate candidate Bruce Braley for claiming in a debate that he voted to give President Obama limited authority to strike ISIS in Iraq and Syria. In fact, he voted to give Obama authority to train and arm the Syrian rebels. His opponent, Joni Ernst, said she would have voted the same way.

Last week, Crossroads GPS made a $5.1 million ad buy in North Carolina, and the first spot it released attacks Sen. Kay Hagan for skipping a congressional hearing on ISIS to attend a fundraiser. Hagan’s campaign responded by pointing out that her opponent, Thom Tillis, has not articulated a specific policy for taking on ISIS that is substantially different from the president’s.

The lack of a clear GOP policy on ISIS, besides criticizing the president and his allies, is less problematic for Republicans, as many GOP candidates in close races don’t have any legislative record on the issue to defend. Even some Democratic political operatives are calling on their Senate candidates to get their messaging straight and present some clearer positions on how they would deal with ISIS.

“What these Republican candidates are benefiting from is an increased sense of fear: fear about ISIS, fear about Ebola, fear about overall general instability in the world,” said Tommy Vietor, a former spokesman for the National Security Council now with Fenway Strategies. “Democrats can’t run from Obama, they can’t run from the issue, all they can do is state forcefully what they would do about it and show they have a backbone. Getting politically scared, as some of these candidates are doing, is a self-fulfilling prophecy.”

There’s also a risk that Republicans could get too cocky on foreign policy and press the fear button so hard it backfires and calls their own competence into question. New Hampshire Senate challenger Scott Brown was among the first GOP candidates to ring the national-security alarm bell in ads but was mocked for suggesting that foreigners might bring Ebola into the United States by walking across the U.S.-Mexico border.

Arkansas Rep. Tom Cotton, a decorated war veteran, similarly warned that ISIS terrorists might collaborate with Mexican drug cartels and take advantage of the porous border. Cotton’s newest ad this week hits the Obama administration for underestimating the ISIS threat. Cotton maintains a steady if small lead over Democrat incumbent Sen. Mark Pryor in the latest polls.

Overall, the GOP is benefiting from the fact that several of its candidates represent the hawkish wing of the party, just as the party is returning to its more hawkish roots and the American people are advocating for a more aggressive foreign policy to deal with ISIS.

“The slate of GOP Senate candidates are some of the most hawkish candidates the Republican Party could have run. A lot of them are veterans, all of them are well to the right of Obama on national security, and they are turning that to their advantage,” said Michael Goldfarb, a Republican operative and publisher of the Washington Free Beacon. “There’s no doubt that an increase in fear has benefited the Republicans, because people rightly blame Obama for it. Obama’s foreign policy has already led to one slaughter in Iraq and Syria, and it may lead to another here in November for the Democrats.”