BERLIN (AP) — German police have foiled a far-right plot to attack refugee shelters in Bavaria amid growing violence against migrants, authorities said Thursday.

Prosecutors said 11 men and two women were detained during raids Wednesday in the town of Bamberg, about 50 kilometers (30 miles) north of Nuremberg. Police, who had been observing the group for more than a year, also seized several kilograms (pounds) of powerful illegal firecrackers, a firearm, ammunition, baseball bats and knives.

Police were able to confirm a suspicion that the group planned to use the explosives — which included two illegal one-kilogram (two-pound) "ball bomb" firecrackers — to attack refugee shelters in Bamberg on Oct. 31 in order to "instill fear and terror among the asylum-seekers," prosecutor Erik Ohlenschlager said.

Explosives experts determined that the "ball bombs" could have blown out windows if thrown near the asylum-seekers' home, or could have even caused serious injury or death if detonated close to people in a confined space, such as a car or a small room, said Werner Mikulasch, the deputy police chief for the Upper Franconia region.

Several of those detained were members of a political party called The Right, while one person was involved in organizing a rally in Nuremberg for an offshoot of the anti-Islam group PEGIDA, Mikulasch said.

At least five of the suspects detained were released after initial questioning but several remained in custody.

German officials have warned that violence against migrants is on the rise at a time when hundreds of thousands of people from Syria, Iraq and elsewhere are seeking refuge in Germany. According to figures provided to The Associated Press, there were more than 576 crimes against or around refugee shelters this year, almost three times as many as in all of 2014, primarily vandalism, propaganda and incitement.

Interior Minister Thomas de Maiziere, who visited one of the refugee shelters on Thursday, lauded police for their work that he said "might have prevented attacks or other crimes."

___

David Rising contributed to this report.