German authorities have thwarted a plot by a Tunisian man who created the deadly toxin ricin using castor bean seeds and planned to use the poison in an Islamic extremist attack, federal prosecutors said.

Sief Allah H, whose last name was not given in line with German privacy laws, was taken into custody on Tuesday during a raid on his apartment in Cologne.

The 29-year-old was formally arrested on Wednesday after a judge reviewed the evidence.

Authorities are still investigating how the suspect planned to use the toxin, but said he was working on a "biological weapon" attack in Germany.

"We don't know how, or how widely, the ricin was to have been distributed," said prosecutors' spokesman Markus Schmitt.

The suspect is believed to have begun procuring material online in mid-May, prosecutors said. He succeeded in creating the toxin this month and investigators found it in the apartment search.

Prosecutors would not say how much ricin the suspect had produced.

The seeds of the castor bean plant are naturally poisonous and can be used to create ricin.

The substance kills the body's cells by preventing them from creating protein. A few milligrams are enough to kill an adult if it is eaten, injected or inhaled. Early symptoms include chest pain, breathing difficulties and coughing.

The suspect is not known to have been a member of a terrorist organisation but did have contacts with extremists, Mr Schmitt said.

"He had contacts with people in the jihadist spectrum," Mr Schmitt said, but would not elaborate on whether those contacts were online, in person or both.

He also would not comment on a report in the top-selling Bild newspaper that US intelligence tipped off German investigators after they detected the suspect's online activity buying the seeds to make ricin.

Bild also reported that the suspect bought bomb-making materials and chemicals used in the production of ricin.

It said the suspect lived in the Chorweiler neighbourhood of Cologne with his wife, a convert to Islam, and four children.

He supposedly used instructions to make a ricin bomb that had been posted online by the extremist Islamic State group.

His wife was initially taken into custody but was later released, prosecutors said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.