BERLIN (AP) — German authorities are testing a substance found at the home of a 29-year-old Tunisian to determine whether it is ricin, amid fears the man may have been preparing to use the toxic substance for an attack, prosecutors said Wednesday.

Authorities raided the man's apartment in the Chorweiler neighborhood of the western city of Cologne late Tuesday and detained him on suspicion of preparing an act of violence, prosecutors said. He was not identified due to the ongoing investigation.

His wife and children were also taken into custody initially but later released.

Police confiscated substances thought to be toxic in his apartment and they were being evaluated by experts to determine exactly what they are. Prosecutors would not comment on the amount of substances seized.

Prosecutors say the man is being investigated for connections to Islamic extremism but so far it's not clear whether the case has links to terrorism. The man has not yet been formally charged.