Two Palestinians armed with a gun and meat cleavers have burst into a Jerusalem synagogue and killed four Israelis before being shot dead in the city's bloodiest attack in years.
The attack on Tuesday was a rare assault on a place of worship and sent shock waves through the country, raising fears that the Israel-Palestinian conflict was taking on a dangerous religious dimension.
All four victims were Israelis with dual nationality - three were US citizens and the fourth British, police said.
Israel's leading ultra-Orthodox website said all four were rabbis.
Israel vowed a harsh response, with Prime Minister Benjamin Netanyahu calling the bloodshed a "direct result" of incitement by Palestinian president Mahmud Abbas and Hamas, vowing to respond with "a heavy hand".
Abbas condemned the killings, but Hamas welcomed the attack, with masked Palestinian militants in southern Gaza holding up knives and axes next to posters of the attackers while others handed out cakes in celebration, an AFP correspondent said.
US President Barack Obama called for calm after what he described as a "horrific attack", urging Israelis and Palestinians to work together to "lower tensions, reject violence and seek a path forward towards peace".
The bloodshed took place as months of unrest gripped Jerusalem's annexed Arab eastern sector, resulting in a string of deadly attacks by lone Palestinians and further inflamed by the death of a Palestinian bus driver in controversial circumstances.
As well as the four killed in Tuesday's attack, eight others were wounded, including two policemen, one of whom is in critical condition, with eyewitnesses saying several people had limbs hacked off.
The assailants were identified by family members as Uday and Ghassan Abu Jamal, cousins from the east Jerusalem neighbourhood of Jabal Mukaber. Both were in their 20s.
Analysts warned a harsh Israeli response could potentially escalate a situation already fraught with tension.
Speaking to journalists at the scene, Jerusalem Mayor Nir Barkat expressed shock at the brutality of the attack.
"To slaughter innocent people while they pray... it's insane," he said.