Two suspected Palestinian men armed with axes and knives killed four people in a Jerusalem synagogue on Tuesday before being shot dead by police, Israeli police and emergency services said, the deadliest such attack in the city in years.
The attack took place shortly after dawn in an ultra-Orthodox neighbourhood of West Jerusalem. Pictures posted by an Israeli army spokesman on the Internet showed a man in a Jewish prayer shawl lying dead, a bloodied butcher's cleaver discarded on the floor and overturned prayer tables.
"We are viewing this as a terrorist attack," said police spokesman Micky Rosenfeld. Israel's ambulance service said at least eight people were seriously wounded.
Police said at least one of the assailants was from East Jerusalem, the predominantly Palestinian side of the city.
Palestinian radio reports described the attackers as "martyrs" and the Islamist group Hamas praised the attack. Loudspeakers at mosques in Gaza called out congratulations.
"Hamas calls for the continuation of revenge operations and stresses that the Israeli occupation bears responsibility for tension in Jerusalem," Hamas spokesman Sami Abu Zuhri said.
Israeli Prime Minister Benjamin Netanyahu blamed the attack on both Hamas and Palestinian President Mahmoud Abbas, who he accused of urging Palestinians towards violence.
"This is a direct result of incitement led by Hamas and Abu Mazen, incitement that the international community has been irresponsibly ignoring," he said in a statement.
"We will respond with a heavy hand to the brutal murder of Jews who came to pray and were killed by lowly murderers."
Violence in Jerusalem, areas of Israel and the Israeli-occupied Palestinian territories has surged in the past month, fuelled by a dispute over Jerusalem's holiest shrine, which has given rise to fears of a religious conflict.
Five Israelis and a foreign visitor have been deliberately run over and killed or stabbed to death by Palestinians. About a dozen Palestinians have also been killed, including those accused of carrying out those attacks.
On Monday a Palestinian bus driver was found hanged in a vehicle in Jerusalem. Israeli police, citing autopsy results, said he had committed suicide but the driver's family said they suspected foul play and the incident led to clashes.
Hamas called for retaliation after the bus driver's death.
Residents trace the violence in Jerusalem to July, when a Palestinian teenager was burned to death by Jewish assailants, an alleged revenge attack for the abduction and killing of three Jewish teens by Palestinian militants in the occupied West Bank.
The summer war in Gaza and a row over access to a Jerusalem compound that is sacred to Muslims and Jews alike have also been triggers for violence.
The synagogue attack was the worst in the city since 2008, when a Palestinian gunman shot dead eight people in a religious seminary school in the city.
Media reports said one of the synagogue attackers was armed with a gun and a hospital spokesman said two people were being treated for gunshot wounds, but police did not immediately confirm that either of the attackers fired a gun.