"We have probably forgotten to take into account what political opponents such as the Islamic State are capable of doing and how they think." — Rudolf van Hüllen, political scientist.

Anis Amri, the Tunisian jihadist who attacked the Christmas market in Berlin, used at least 14 different identities, which he used to obtain social welfare benefits under different names in different municipalities.

German authorities knew in early 2015 that Walid Salihi, an 18-year-old Syrian who applied for asylum in Germany in 2014, was recruiting for the Islamic State at his asylum shelter in Recklinghausen, but they did nothing.

The German experience with jihadists posing as migrants serves as a case study on errors for other countries to avoid. German authorities allowed hundreds of thousands of migrants, many lacking documentation, to enter Germany without a security check. German authorities admitted they lost track of some 130,000 migrants who entered the country in 2015.

More than 400 migrants who entered Germany as asylum seekers in 2015 and 2016 are being investigated for links to Islamic terrorism, according to the Federal Criminal Police.

German political leaders and national security officials knew that Islamic State jihadists were entering Europe disguised as migrants but repeatedly downplayed the threat, apparently to avoid fueling anti-immigration sentiments, according to an exposé by German public television.

German officials knew as early as March 2015 — some six months before Chancellor Angela Merkel opened German borders to more than a million migrants from the Muslim world — that jihadists were posing as refugees, according to the Munich Report (Report München), an investigative journalism program broadcast by ARD public television on January 17.

More than 400 migrants who entered Germany as asylum seekers in 2015 and 2016 are now being investigated for links to Islamic terrorism, according to the Federal Criminal Police (Bundeskriminalamt, BKA).

The revelations come amid criticism of U.S. President Donald J. Trump's plans to suspend immigration from select countries until mechanisms are in place to properly vet migrants entering the United States. The German experience with jihadists posing as migrants serves as a case study on errors for other countries to avoid.

Based on leaked documents and interviews with informants, the Munich Report revealed that German authorities knew in early 2015 that Walid Salihi, an 18-year-old Syrian who applied for asylum in Germany in 2014, was recruiting for the Islamic State at his asylum shelter in Recklinghausen, but they did nothing. Some six months later, a search of Salihi's accommodation produced a shotgun. Salihi was not deported.

It later emerged that between 2011 and 2015, Salihi had used seven aliases to apply for asylum not only in Germany, but also in Austria, Italy, Romania, Sweden and Switzerland. He had also been charged in several countries with a laundry list of crimes, including physical assault, robbery and weapons offenses.

In February 2014, for example, Salihi was arrested for sexually assaulting women at a discotheque in Cologne. That same month, he physically assaulted a homeless man, attacked a random passerby and attempted to strangle a fellow resident at his asylum shelter. Police later traced his cellphone to downtown Cologne on December 31, 2015, when hundreds of German women were sexually assaulted by mobs of Muslim migrants.

On January 7, 2016, Salihi stormed a police station in the 18th district of Paris while shouting "Allahu Akbar." He was carrying a butcher knife, an Islamic State flag and was wearing what appeared to be an explosive belt. Police opened fire and shot him dead.

A former roommate described Salihi: "He was very aggressive, especially when it came to religion. To him, all unbelievers were worthless and had to die."

Salihi was not an isolated case. According to the Munich Report, in early 2015 American intelligence agencies warned German authorities that Islamic State jihadists posing as migrants were making their way through southern Europe with the aim of reaching Germany.

The warnings, however, were ignored, and in the summer of 2015, German authorities allowed hundreds of thousands of migrants, many lacking documentation, to enter Germany without a security check.

At the time, leading German security experts insisted that the Islamic State would not send jihadists to Europe. In October 2015, for example, Holger Münch, President of the Federal Criminal Police (Bundeskriminalamt, BKA), said: "We do not have a single case yet in which it has been confirmed that members of a terrorist group from Syria or Iraq have come here to Germany specifically to commit attacks."

Münch also said: "If you look at the risks you face by coming to Germany via the Mediterranean Sea, I think there are simpler ways to get here if you plan to do so, and you do not need a stream of refugees."

Gerhard Schindler, President of the Federal Intelligence Service (Bundesnachrichtendienst) said: "It is unlikely that terrorists will use the dangerous boat route across the Mediterranean to get to Europe."

German political scientist Peter Neumann, who is Director of the International Centre for the Study of Radicalisation and Political Violence at King's College in London, said:

"There is not a single shred of evidence, proven evidence, that an Islamic State sympathizer has been smuggled to Europe. There is even less evidence that this has been an active strategy of the Islamic State. It is important that politicians do not express their own opinions and strengthen the public's fears."

Neumann also said:

"In recent weeks there have been a series of Islamic State videos in which it was quite clearly stated that supporters of the Islamic State should remain in the Islamic State and that they should not try to emigrate, and that this active infiltration strategy, about which is sometimes reported, is non-existent."

Less than a month later, on November 13, 2015, Islamic State jihadists, the majority of whom entered Europe by posing as migrants, carried out the coordinated Paris attacks in which 137 people died and nearly 400 were injured.

In 2016, the true scale of the German problem of jihadists posing as migrants began to come into focus:

February 4. German police arrested four members of a cell allegedly planning jihadist attacks in Berlin. The ringleader — a 35-year-old Algerian who was staying at a refugee shelter in Attendorn with his wife and two children — posed as an asylum seeker from Syria. He had reportedly received military training from the Islamic State.

February 5. Hans-Georg Maassen, the head of Germany's BfV domestic intelligence agency, revealed that more than 100 Islamic State fighters may be living in Germany as refugees, some of whom are known to have entered the country with fake or stolen passports.

February 8. German police arrested an alleged Islamic State commander, living at a refugee shelter in Sankt Johann. The 32-year-old jihadist, posing as a Syrian asylum seeker, entered Germany in the fall of 2015.

February 29. German authorities admitted they lost track of some 130,000 migrants who entered the country in 2015. The revelation raised concerns that unaccounted migrants could include jihadists who entered the country posing as refugees.

June 2. German police arrested three suspected Islamic State members from Syria on suspicion of preparing an attack in Düsseldorf.

June 3. The head of the German police union, Rainer Wendt, said that budget cuts in the public sector made it impossible to vet all of the migrants coming into Germany. He was responding to demands that all migrants undergo immediate security checks.

July 19. A 17-year-old Afghan asylum seeker brandishing an axe and shouting "Allahu Akbar" seriously injured five people on a train in Würzburg. The assailant was shot dead by police after he charged at them with the axe. The teenager had been placed with a foster family just two weeks before the attack as a reward for being "well integrated."

July 24. Mohammed Daleel, a 27-year-old migrant from Syria whose asylum application was rejected, injured 15 people when he blew himself up at a concert in Ansbach. The suicide bombing was the first in Germany attributed to the Islamic State.

July 25. The Federal Criminal Police revealed that more than 400 migrants who entered Germany as asylum seekers in 2015 and 2016 were being investigated for links to the Islamic State.

September 13. German police arrested three Syrian jihadists in Schleswig-Holstein and Lower Saxony. Prosecutors said the three came to Germany in November 2015 posing as migrants and with the intention of "carrying out a previously determined order from Islamic State or to await further instructions."

September 17. Bavarian Interior Minister Joachim Herrmann accused the Federal Office for Migration and Refugees (BAMF) of failing to root out potentially tens of thousands of fake passports. Many migrants who entered Europe as Syrians are, in fact, from another country of origin. Almost 40% of all Moroccans who entered Greece falsely represented themselves as Syrians, according to one study.

October 10. The BAMF knowingly allowed more than 2,000 asylum seekers with fake passports to enter Germany.

October 27. Public prosecutors charged Shaas Al-M, a 19-year-old Syrian jihadist who arrived in Germany posing as a refugee, with plotting to bomb popular tourist sites in Berlin, including the Brandenburg Gate and the Reichstag, for the Islamic State.

December 19. At least 12 people were killed and dozens injured after a truck rammed into a Christmas market in Berlin. The main suspect in the attack was Anis Amri, a 23-year-old migrant from Tunisia who arrived in Germany in July 2015 and applied for asylum in April 2016. Although Amri's application for asylum was rejected in June 2016, he was not deported because he did not have a valid passport.

On January 5, 2017, it emerged that Amri used at least 14 different identities, which he used to obtain social welfare benefits under different names in different municipalities.

German political scientist Rudolf van Hüllen concluded:

"We have probably forgotten to take into account what political opponents such as the Islamic State are capable of doing and how they think. We have not tried to understand their mentality, and therefore we have overlooked the fact that for the Islamic State it was an obvious option to use the safe refugee routes. This is a quite logical matter."

Soeren Kern is a Senior Fellow at the New York-based Gatestone Institute. He is also Senior Fellow for European Politics at the Madrid-based Grupo de Estudios Estratégicos / Strategic Studies Group. Follow him on Facebook and on Twitter.