(Reuters) - Two Palestinians armed with a meat cleaver and a gun killed four people in a Jerusalem synagogue on Tuesday before being shot dead by police, the deadliest such incident in six years in the holy city amid a surge in religious conflict.
Israeli Prime Minister Benjamin Netanyahu pledged to respond with a "heavy hand", and again accused Western-backed Palestinian President Mahmoud Abbas of inciting violence in Jerusalem.
Abbas condemned the attack, which comes after a month of unrest fueled in part by a dispute over Jerusalem's holiest shrine.
A worshipper at the morning service in the Kehillat Bnei Torah synagogue in an ultra-Orthodox neighborhood of West Jerusalem said about 25 people were praying when shooting broke out.
"I looked up and saw someone shooting people at point-blank range. Then someone came in with what looked like a butcher's knife and he went wild," the witness, Yosef Posternak, told Israel Radio.
Photos distributed by Israeli authorities showed a man in a Jewish prayer shawl lying dead, a bloodied butcher's cleaver on the floor, several overturned prayer tables and prayer books covered in blood.
"We are viewing this as a terrorist attack," said police spokesman Micky Rosenfeld, who confirmed the four dead and that the two assailants, both from predominantly Arab East Jerusalem, had been shot dead by police.
Israel's ambulance service said at least eight people were seriously wounded.
The Popular Front for the Liberation of Palestine (PFLP), said it carried out the attack.
"We declare full responsibility of the PFLP for the execution of this heroic operation conducted by our heroes this morning in Jerusalem," said Hani Thawbta, a PFLP leader in Gaza.
Police identified one of the dead as Rabbi Moshe Twersky, who taught at a Jerusalem seminary. Twersky was from a Hassidic rabbinical dynasty and a grandson of Joseph Soloveitchik, a renowned Boston rabbi who died in 1993.
In a statement, Abbas said: "The presidency condemns the attack on Jewish worshippers in one of their places of prayer in West Jerusalem and condemns the killing of civilians no matter who is doing it."
U.S. Secretary of State John Kerry described the attack as an act of "pure terror", and his spokeswoman said he phoned Netanyahu to offer condolences.
Palestinian radio described the attackers as "martyrs" and the Islamist group Hamas praised the attack. Loudspeakers at mosques in Gaza called out congratulations and youngsters handed out candy in the streets.
Palestinian media named the attackers as Ghassan and Udai Abu Jamal, cousins from the Jerusalem district of Jabal Mukaber, where clashes broke out as Israeli security forces moved in to make arrests.
"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.
The synagogue attack came a day after a Palestinian bus driver was found hanged in his vehicle in Jerusalem. Israel said an autopsy showed he committed suicide, but his family said he was attacked. Hundreds of mourners at the driver's funeral on Sunday chanted for revenge.
Netanyahu said the synagogue attack was "a direct result of incitement" led by Hamas and Abbas, "incitement that the international community has been irresponsibly ignoring."
"We will respond with a heavy hand to the brutal murder of Jews who came to pray and were killed by lowly murderers," said Netanyahu, who summoned his security cabinet for a special session.
Violence in Jerusalem, areas of Israel and the Israeli-occupied Palestinian territories has surged in the past month, fueled in part by a dispute over Jerusalem's holiest shrine.
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.
The synagogue attack was the worst in the city since 2008, when a Palestinian gunman shot dead eight people in a religious school.
The founder of Israel's Zaka emergency service, which attended the scene, described it as like the slaughter of Jews in Europe during the Holocaust.