BERLIN (Reuters) - The anti-immigrant party Alternative for Germany (Afd) gained support as Germany was hit by a spate of attacks this month, including by Islamist militants, but support for Chancellor Angela Merkel's conservatives held steady, a poll showed.

Germany remains deeply unsettled after 15 people were killed and dozens wounded in five separate attacks between July 18-July 26. Two were claimed by Islamic State, and three of the attackers were asylum seekers.

This has led to accusations that Merkel's open-door refugee policy is to blame, under which over a million migrants, many fleeing war in Afghanistan, Syria and Iraq, entered Germany in the past year.

An Emnid poll for weekly newspaper Bild am Sonntag showed support for the AfD rising by 2 percentage points from the prior week to 12 percent. The poll was conducted between July 21 and July 27.

Officials say two of the assailants, a Syrian asylum seeker who blew himself up in Ansbach and a refugee from either Pakistan or Afghanistan who attacked people on a train in southern Germany, had links to Islamist militancy.

The death toll of 15 includes four assailants. France also suffered two attacks claimed by Islamic State in July, including one in which a gunman drove a heavy truck into a crowd celebrating Bastille Day in Nice, killing at least 84 people.

The AfD enjoyed 15 percent support earlier this year and voters turned in droves to the party in three regional elections in March, giving a thumbs down to Merkel's refugee policy.

But earlier this month, the AfD, which was founded in 2013 on a eurosceptic platform and then shifted focus to an anti-immigration stance, lapsed into party infighting over what some regional lawmakers called the anti-Semitic views of a colleague.

However, the Emnid poll showed support for Merkel's conservatives and their coalition partners, the left-leaning Social Democrats, was unchanged at 35 percent and 23 percent respectively.

The AfD's gains came at the expense of the Greens, support for whom dipped by 1 point to 11 percent, and the far-left Linke, who also suffered a 1 point fall, to 9 percent. Germany is set to hold a federal election in autumn next year.

The resilient support for her conservatives is positive news for Merkel, who on Thursday defiantly repeated her "we can do this" mantra on handling the migrant influx into Germany, and vowed not to bend her refugee policy.

(Writing by Paul Carrel; Editing by Raissa Kasolowsky)