Frankfurt am Main (AFP) - German police have arrested a Tunisian man after discovering "toxic substances" at his flat in Cologne, officials said Wednesday, with prosecutors not ruling out a possible terror motive.

German news weekly Der Spiegel, citing security sources, named the suspect as Sief Allah H. and said he had been trying to build a bomb containing the deadly poison ricin using ingredients he bought online.

The 29-year-old was detained late Tuesday after officers raided his home and came across "unknown substances" that are currently being analysed by specialists, Cologne police said in a statement.

"We decided to take very swift action to ward off possible danger," police spokesman Andre Fassbender told DPA news agency.

Police declined to comment on reports that the suspect was planning to manufacture a biological weapon.

The federal prosecutor's office, which handles terror-related cases in Germany, has opened a probe against the Tunisian on suspicion of "preparing a serious act of violence against the state".

But a spokesman for the prosecution service said it was too soon to say an attack was in the works.

The suspect's wife was also briefly taken in for questioning but she is not under investigation.

According to broadcaster NTV, the wife is a German national who recently converted to Islam. The couple have several children.

Police officers, including special forces, were still combing the family's flat on the first floor of a large apartment building on Wednesday.

Chemical experts wearing protective gear were seen removing plastic bags from the scene.

- Highly fatal -

Germany's domestic intelligence service was tipped off about the suspect by foreign authorities after they grew suspicious of his online purchases, Spiegel reported.

The suspect had bought several components that could be used to build a bomb, as well as "a thousand seeds from a plant that can be used to make ricin", it wrote.

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.

Story continues

The suspect was thought to have been following instructions disseminated by the Islamic State group on how to build a bomb containing ricin, Spiegel said, but police reportedly did not find a working explosive device at the flat.

The Tunisian's arrest 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 recent years.

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.