The assailant was of Iranian origin, and an official investigation was underway to determine a possible motive, Prasquier said. The attacker, now in police custody, had escaped from a psychiatric hospital near southeastern Lyon last week, said a police official on condition of anonymity because he was not authorized to speak publicly about the matter.

Agnes Thibault-Lecuivre, a spokeswoman for the Paris prosecutor’s office, said the two victims had been wearing Jewish skullcaps, and the attacker was detained after a chase through the synagogue. The Simon Wiesenthal Center, which monitors anti-Semitic incidents worldwide, said in a statement that the assailant screamed “Allah-u-Akbar” — or “God is great” — during the attack.