The public thinks Republicans will do a better job keeping the U.S. safe by a wider margin than at any time since 2002, according to a Gallup poll.

The poll finds that 55 percent of adults think Republicans will do a better job protecting the country from terrorism and military threats, while 32 percent think Democrats will. 

The poll comes as fears of the Islamic State in Iraq and Syria have dominated the news, despite statements from U.S. officials that the group is not currently known to be plotting attacks on the U.S. It was conducted Sept. 4-7, before President Obama's speech on Wednesday night laying out a strategy to defeat ISIS. 

Republicans' lead on the issue has widened drastically in just two years, as foreign crises have grown to plague Obama. In 2012, the parties were essentially tied in the public's mind on keeping the country safe. In 2013, Republicans had a 6-point lead. Now they have a 23-point lead.

Republicans have led for most of the years since Gallup began asking the question in 2002, following the Sept. 11, 2001, attacks, but Democrats did briefly hold a lead in 2007. That was during a low point in President Bush's popularity. 

On the domestic side, Republicans also have the lead, with possible repercussions in the midterm elections. Asked which party will do a better job keeping the country prosperous, 49 percent say Republicans, and 40 percent say Democrats.