German investigators were scouring Berlin last night for a Syrian man believed to have been planning a bomb attack after a raid uncovered several hundred grams of “highly volatile” explosives in an apartment — a discovery one local expert says should highlight the importance of vetting refugees flooding out of the war-torn region.

Although authorities didn’t say whether the suspect, identified as 22-year-old Jaber Albakr from the Damascus area, was among the more than 890,000 asylum seekers who poured across the German border last year, secur-?ity sources said he was believed to be connected to Islamic ?extremist groups and was “known” to members of the ?intelligence community — details that fueled speculation of Islamic State involvement.

“A portion of the refugees have exploited these openings to commit terrorist acts,” Northeastern University professor and terror expert Max Abrahms said of the wave of refugees who have fled the Civil War in Syria that has ravaged their country.

“There are many combatants in Syria. If you allow a large number into the country — especially unvetted — you’re bound to have some terrorists.”

About 100 people were evacuated from the five-story apartment building after local authorities found hidden explosives while acting on a tip that Albakr may be living there and that he was actively planning a bomb attack. The explosives, which Saxony police spokesman Tom Bernhardt said were “well-hidden” in the apartment, were destroyed in a controlled explosion. The chemicals, Berhardt said, were a “highly volatile mixture” considered more dangerous than TNT.

After two people who had “contacts” with Albakr were taken into custody near a ?local train station and a third was found downtown, authorities ?issued an alert along with a photo of a dark-haired man wearing a hooded sweatshirt and said he was last seen wearing similar clothes. Those detained were ?being questioned with the hope that they might help authorities find Albakr, investigators said.

Authorities have not said where or when they suspect the attack was going to take place.

The country has been on edge since two attacks this summer claimed by the Islamic State in which multiple people were ?injured and both assailants died. The possible bomb plot is expected to fuel calls for tighter border security from citizens who fear German Chancellor Angela Merkel’s immigration policies are putting the public in harm’s way, Abrahms said.

“Merkel allowed into Germany a huge number of asylum seekers and she did this for altruistic ?reasons,” Abrahms said.

“But they were quite naive in thinking there would be trivial security costs.”

Herald wire services contributed to this report.