The 29-year-old, identified as Sief Allah H., was detained after police stormed his flat in Cologne late Tuesday, where they found unknown “toxic substances” that turned out to be ricin.
“He is strongly suspected of intentionally manufacturing biological weapons,” federal prosecutors said in a statement.
The suspect has been charged with violating German law on the possession of weapons of war, and “preparing a serious act of violence against the state”.
But prosecutors cautioned that it remained unclear whether he was planning to use ricin to carry out an Islamist attack in Germany.
“There are no indications that the accused belongs to a terrorist organization, nor of any concrete attack plans at a certain time or place,” they said.
According to German media, the police raid came after German intelligence services were tipped off by foreign authorities who had grown suspicious of the suspect's online purchases.
Prosecutors said Sief Allah H. started buying the necessary equipment and ingredients to make ricin in mid-May — including an online purchase of “a thousand castor seeds and an electric coffee grinder”.
He succeeded in manufacturing the toxin earlier this month. The dangerous substance has been secured by the authorities, they added.
Ricin — a poison that is produced by processing castor beans — has no known antidote and is one of the world's most lethal toxins.
It is 6,000 times more powerful than cyanide.
German news weekly Der Spiegel reported that Sief Allah H. was thought to have been following instructions disseminated by the Islamic State group on how to build a bomb containing ricin.
The case comes less than a month after French authorities said they had foiled a terror attack possibly involving the use of ricin. Two brothers of Egyptian origin were arrested.
Germany remains on high alert for jihadist attacks after several assaults claimed by the Islamic State group in the country.
In the worst such attack, Tunisian asylum seeker Anis Amri rammed a truck into crowds at a Berlin Christmas market in December 2016, killing 12.