A 23-year-old Syrian armed with a knife on Friday ran into a Berlin synagogue, and was arrested at the entrance.

According to eyewitnesses, the Syrian yelled "Allahu akhbar" and anti-Israel statements.

The synagogue's two guards immediately drew their weapons, and a colleague requested police reinforcements, En24.news reported Saturday.

Police arriving at the scene sprayed pepper gas in the would-be stabber's face, the site added.

En24.news quoted a police spokeswoman who said: "We are investigating in all directions."

The suspect's apartment was searched, and electronics and documents were confiscated, but the suspect was ultimately released Saturday morning.

"So far the man has not appeared in the police [records]," the spokeswoman said. "He was also released. Grounds for detention are not available."

She said no political motive was immediately recognizable, but state security is investigating the case.