Police spokeswoman Luba Samri said the attackers were Palestinians from East Jerusalem.
Police suspected a third terrorist may have been involved but later rejected the idea.
Prime Minister Benjamin Netanyahu said Israel would “respond with a firm hand to this brutal murder of Jews who went to pray and were scathed by despicable murder”.
Hamas welcomed that attack, describing it as "a quality development in the confrontation with the Israeli occupation".
US Secretary of State John Kerry said the attack was an act of "pure terror".
He called for Palestinian leaders to condemn the attack.