A 17-year-old boy was arrested in Hamburg on suspicion that he was planning an attack on potential civilian and policing targets, prosecutors said Monday. Authorities said the suspect was taken into custody in Hamburg on Thursday and that the case is being handled in Germany’s second-biggest city.

Prosecutors said the alleged plan involved attacks on a shopping mall, a bar or a police station. They said the investigation concerns preparation for a terror act and terror financing, without providing details about when an attack might have been carried out.

Prosecutors said the Islamic State extremist group appeared to have inspired the suspect. In describing the alleged intent, prosecutors said the boy planned to kill an undetermined number of “infidels,” and they said he was considering using explosives, Molotov cocktails or a knife.

Prosecutors said investigators had taken steps that led to the seizure of materials last week, including fertilizer, lighter fluid, a balaclava and a knife. They did not describe how the items were connected to any specific device or plan.

The authorities said prosecutors previously had ordered a psychiatric assessment of the suspect in connection with a separate investigation into alleged violations of Germany’s law governing associations and other offenses, and they did not elaborate on that earlier case.