JERUSALEM (Reuters) - Two Palestinians armed with a meat cleaver and a gun killed five people in a Jerusalem synagogue on Tuesday before being shot dead by police, the deadliest such incident in six years in the holy city.
Three of the victims held dual U.S.-Israeli citizenship and a fourth man was a British-Israeli national, police said.
A police officer who responded to the scene was shot and later died of his wounds.
Israeli Prime Minister Benjamin Netanyahu accused Palestinian President Mahmoud Abbas of inciting violence in the city and said the killings, along with a spate of recent attacks, were part of a "battle over Jerusalem".
"As a nation we will settle the score with every terrorist and their dispatchers, and we have proved we will do so, but no one may take the law into their own hands, even if spirits are riled and blood is boiling," Netanyahu said in broadcast remarks.
Abbas condemned the attack, which came after weeks of unrest fueled in part by a dispute over Jerusalem's holiest site, known to Muslims as the Noble Sanctuary - containing the al-Aqsa mosque, the third holiest in Islam - and to Jews as the Temple Mount because the two Biblical temples once stood there.
A worshipper in the Kehillat Bnei Torah synagogue in an ultra-Orthodox neighborhood of Jewish West Jerusalem said about 25 people were praying in a service 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," Yosef Posternak told Israel Radio.
Photos distributed by Israeli authorities showed a man in a prayer shawl lying dead, a bloodied butcher's cleaver on the floor and prayer books covered in blood.
U.S. President Barack Obama said in a statement: "I strongly condemn today's terrorist attack on worshippers at a synagogue in Jerusalem, which killed four innocent people, including U.S. citizens Aryeh Kupinsky, Cary William Levine and Mosheh Twersky, and injured several more."
Speaking to reporters at the White House, Obama said too many Israelis and Palestinians had died in recent violence and called on both sides to lower tensions.
U.S.-brokered peace talks collapsed in April after Abbas signed a unity deal with the Islamist group Hamas that advocates Israel's destruction. Palestinians have also been angered by continued Israeli settlement building in the West Bank and East Jerusalem.
Violence in Jerusalem, other areas of Israel and the Israeli-occupied Palestinian territories has surged in the past month. Abbas has said Muslims have a right to defend their sacred places if attacked.
Five Israelis and a foreign visitor were killed in the Palestinian attacks that preceded Tuesday's incident. At least 10 Palestinians have also been killed, including those accused of carrying out the attacks prior to the synagogue assault.
Israeli police spokesman Micky Rosenfeld said the two assailants, both from Israeli-annexed East Jerusalem, were shot dead by police in a gun battle outside the synagogue. Netanyahu said Israel would demolish their homes.
Israel's ambulance service said at least eight people were seriously wounded.
The militant Popular Front for the Liberation of Palestine said it carried out the attack, calling it a "heroic operation".
Four of the dead - Twersky, 59, Kupinsky, 43, Levine, 55, and Avraham Shmuel Goldberg, a 68-year-old British-Israeli - were ordained rabbis.
A Jewish seminary lecturer, Twersky was from a Hasidic rabbinical dynasty. Thousands of mourners attended his funeral.
Palestinian radio described the attackers as "martyrs" and Hamas, the dominant group in the Gaza Strip, praised the attack. Loudspeakers at mosques in Gaza called out congratulations and youngsters handed out candy in the streets.
Palestinian media named the assailants 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.
Abbas said in a statement: "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."
The attack raised Israelis' concern about a new Palestinian uprising. Internal Security Minister Yitzhak Aharonovitch said he was seeking a partial easing of gun controls so military officers and security guards could carry weapons while off-duty.
A day before the incident, a Palestinian bus driver was found hanged in his vehicle in Jerusalem. Israel said he committed suicide, but his family said he was attacked and mourners at his funeral chanted for revenge.
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 synagogue attack was the worst in the city since 2008, when a Palestinian gunman killed eight people in a religious school.
Additional reporting by Nidal al-Mughrabi and Noah Browning; Editing by Tom Heneghan and Tom Brown