A man has been reportedly detained by German police over plans to carry out a terrorist attack at a festival in the town of Eisenhuttenstadt.

Explosives have been found in the suspect’s apartment, local media say, citing police.

Police have also found materials linked to Islamic State (IS, former ISIS/ISIL) as the search of the suspect’s apartment continues, German media report. According to news agency DPA, the suspect had a Salafist background and was under police supervision.

The suspect reportedly planned to set off an improvised explosive device filled with nails at a festival in Eisenhuttenstadt that was due to take place on August 26-28.

Eisenhuttenstadt is a town with 30,000 inhabitants located on the German border with Poland, 120km from Berlin. It also hosts the central refugee reception center in the German region of Brandenburg.

Brandenburg Prime Minister Dietmar Woidke confirmed the arrest and told journalists that a “police operation was carried out on suspicion of [a man] possessing explosives and preparing a terrorist attack,” as reported by Tagesspiegel daily. The person detained is suspected of having links to Islamists.

Germany has witnessed a series of terrorist attacks and violent incidents in recent months. Two attacks were linked to Islamic State (IS, formerly ISIS/ISIL), while two other assaults had no links to any terrorist group.

On July 18, a 17-year-old “unaccompanied minor” of Afghan origin armed with an axe and a knife attacked commuters on a train in Wurzburg, injuring five people.

Another attack occurred on July 24 in the Bavarian city of Ansbach, where a 27-year-old Syrian, who had been rejected asylum, set off an improvised bomb hidden in his backpack, killing himself and injuring 12 people.

Meanwhile, Germany’s domestic intelligence agency said on August 15 it had recorded at least 340 attempts by Islamic State and other Islamist groups to recruit potential fighters in refugee centers and local mosques.

The Bavarian intelligence service has warned that IS fighters could have infiltrated Germany by posing as refugees, citing “irrefutable evidence” of planned attacks.

The German domestic intelligence service (BfV) also estimates that about 43,000 Islamists live now in the country, stressing that their numbers have significantly increased in the last years, Bild daily reports. The intelligence agency added that it sees many such Islamic radicals as “dangerous.”