A Syrian migrant and known Islamic State sympathiser was stopped at the Danish-German border after he was found to have materials for making explosives – but was let go by German police.

German public broadcaster NDR reports that the migrant had checked in at the ferry port in Puttgarden, Germany, intending to travel to Denmark, when he was intercepted by German federal police and was found to have 17,000 matches, radio equipment, and an ignition device.

The chemical with which matches are ignited is often used as a building block for detonators and is listed as a material for constructing detonators in various instructions of Islamic terrorists.

However, the federal police let the 20-year-old Syrian go after confiscating the items.

The would-be bomber then boarded a train and returned to the migrant home in which he lived in the city of Ulm, Biberach, some 450 miles away.

A spokesman for the German prosecutor, Jan Holzner, confirmed that the Syrian was arrested in his home in the southern German state of Baden-Württemberg on suspicion of preparing to carry out an act of terror – days after the attempted border crossing. He is now in custody in Stuttgart.

Mr. Holzner said that the suspected bomb materials themselves were harmless, but that the quantity was “not typical of what you would find in a normal household”.

“We see the urgent suspicion that he has procured the things to make a blasting or fire device,” he said, but added: “We cannot prosecute him on matches alone.”

According to authorities, the 20-year-old is well-known to police. As early as 2015, the Syrian was reported to police by other migrants at the camp for his “radical views”. The prosecutor has confirmed: “We have proof that he sympathises with Islamic State.”

It is not known whether the Syrian had contact with members of Islamic State outside Germany.

Terror expert Holger Schmidt told SWR that one can be “glad that the man had returned to where he came, because if he had not gone back to Biberach, the investigators would probably have stood by relatively helpless.

“But the great question for the coming days is why the federal police did not actually know that this man was at least a highly interesting person to the Ulm police – because he had a history.”