BERLIN (Reuters) - A Tunisian detained in Germany on suspicion of planning an Islamist-motivated attack produced ricin and tested the lethal toxin on a hamster, prosecutors said on Friday.

The 29-year-old man, who was arrested in June, is suspected of building a “biological weapon” with ricin, a poison found in castor beans, the Federal Prosecutor’s Office said in a statement.

The man, named only as Sief Allah H. in line with German legal practice, bought the hamster with his wife at a pet shop in the western city of Cologne, it said, without revealing the rodent’s fate.

Investigators seized 3,150 grains of ricin - all ordered via the Internet - during a search of the suspect’s home in Cologne in June, along with 84.3 mg of prepared ricin.

Prosecutors have said they believe the suspect had considered building an explosive device, but no target or timetable had been set.

The suspect and his wife, identified only as Yasmin, had wanted to move to Islamic State-controlled areas of Syria, the prosecutor’s office said. She is accused of helping her husband to prepare an attack.

Sief Allah H. twice tried to enter Syria via Turkey in 2017 but both attempts failed, prosecutors said, adding that he then set up contact with Islamic State agents who instructed him to carry out an attack against “infidels”.

In May 2018 he received instructions from individuals abroad via an online messaging service on how to prepare a bomb. He then ordered 250 metal balls from an online supplier, wanting to use them as shrapnel in a bomb.

Prosecutors also accuse Sief Allah H. of seeking to become a member of the Islamic State and of swearing allegiance to its leaders.