One of the charged, identified as Azizjon B., is suspected of having close contact with two high-ranking IS leaders in Afghanistan and operating a Russian- and Tajik-language online network to spread IS propaganda, it said in a statement.
The five suspects, who were arrested last year, were suspected of belonging to an IS cell in the western state of North Rhine-Westphalia whose members received instructions and material to build bombs and plotted attacks in Germany.
The statement said they trained with paint ball games to improve their military skills and tactics. Some of the sessions' participants were believed to have had contact with the Islamist gunman who killed four people in a rampage in Vienna last year.
The prosecutors' statement said the network raised funds for Islamic State operations and recruited would-be militants.
It played an important role in radicalizing a man who plowed a vehicle into a crowd in the Swedish capital Stockholm in 2017, killing four people and injuring 15 others, it said.
Last week Danish police said they had arrested 13 people while German police had arrested one more on suspicion of trying to make explosives and planning a terrorist attack in either Denmark or Germany.