The arrival of refugees heading to Europe has slowed somewhat over the past few months. But there are still thousands of people from war-torn nations in the Middle East or Africa who are coming to Germany and other European countries looking for safety. The problem: they're not welcomed with open arms in most places.

Polling institute Ipsos asked more than 16,000 people in 22 countries how they felt about refugees, immigration and their countries' border policies. The results show that attitudes toward immigrants vary from country to country, but also that skepticism about refugees and fear of terrorists is rather high across the board.

Respondents answered the questions between June 24 and July 8, so before the slew of attacks that rocked Europe starting later in July. The terrorist attack in Nice, the axe and knife assault in Würzburg, the attempted bombing of a music festival in Ansbach and the murder of a Catholic priest in France - they were all committed by perpetrators with an immigrant background, but didn't play a role in this Ipsos poll.

Many regard refugees with suspicion

Even before those events, fear of terrorists disguising themselves as refugees was high in almost all countries included in the survey. An average of 31 percent of respondents agreed very much with the statement "There are terrorists pretending to be refugees who will enter my country to cause violence and distruction." Another 30 percent chose the "agree somewhat" option.

Taken both these options together, a whopping 83 percent of respondents in Turkey are wary about the refugees entering their country and worried about terrorists hiding among them. In Germany, 71 percent of poll participants believe somewhat or very much in the idea that some of the refugees coming to Germany are dangerous.

There is one exception: in Spain, a large majority rejects the statement. Only 16 percents of those surveyed believes that the refugee stream is also bringing terrorists to Spain. 26 percent somewhat disagreed with the statement posed to them and 38 percent disagreed very much.

Not everyone wants to close the borders

"Immigration is a global issue, with very few countries entirely at ease with current levels, control and the impact of the mass movement of people," Bobby Duffy, Managing Director of Ipsos MORI's Social Research Institute, said in a statement the institute released along with the poll results.

It seems that locals in Turkey and Hungary are the least at ease with current levels of immigration and want to stem the tide. 83 percent of polled Turks agreed with the statement "We must close our borders to refugees entirely - we can't accept any at this time." In Hungary, 72 percent agreed.

In Great Britain, a majority of 60 percent opposes closing the country's borders to refugees.

"This might seem surprising given that the desire to reduce immigration was undoubtedly a key reason for the Brexit vote," Ipsos director Duffy said. He also points out, however, that more and more Brits are coming to the realization after the referendum that they've been "focusing on immigration too much."

In Germany, where conservative politicians from parties like the right-wing "Alternative for Germany" are thriving on anti-immigrant sentiments, the population seems split on the question of closing borders. 44 percent agreed that the country should take no more refugees, 45 percent strongly or somewhat disagreed. The remaining 11 percent said they didn't know what the right way to go should be.

Germans don't see positive impact of immigration

The feelings toward immigrants in Germany have been following a roller coaster-like pattern for the last few years. In 2011, 53 percent of Germans polled by Ipsos said that there were too many immigrants in their country and only 16 percent said that immigrants were having a positive impact on Germany.

By July 2015, only 43 percent thought there were too many immigrants. But the wave of refugees coming into the country that summer changed people's minds and this July, the number is back up to 50 percent.

It's still a measly 18 percent of Germans polled that say immigrants have a positive impact on their country. It remains to be seen if this number decreases even more in the October 2016 poll, which will reflect people's feelings and fears after the terrorist attacks in Würzburg and Ansbach.