BERLIN — A heavily armed gunman with a live-streaming head camera tried to storm a synagogue in eastern Germany on Wednesday as congregants observed the holiest day in Judaism. Foiled by a locked door, he killed two people outside and wounded two others in an anti-Semitic spree that smacked of far-right terrorism.

Hours later the police announced the arrest of a suspect in the assault in the city of Halle, one of the most brazen in a string of recent attacks aimed at Jews in Germany. Police officials declined to confirm if the suspect was the gunman or whether he had any accomplices.

The methodology of the assailant bore a striking resemblance to the rampage by a far-right extremist against two mosques in Christchurch, New Zealand, more than six months ago, in which he broadcast his killings live on social media. Fifty-one people died in that attack.

[Read: Following latest attack, Germans are told far-right terrorism is the number one threat.]

Like the Christchurch killer, the Halle assailant recorded himself, in a 35-minute video of shooting, mayhem and hateful language. In accented English, he identified himself as Anon, denied the Holocaust, denounced feminists and immigrants, then declared: “The root of all these problems is the Jew.”