Israel vowed harsh retaliation Tuesday for a Palestinian attack that killed five people and left blood-smeared prayer books and shawls on the floor of a synagogue in Jerusalem - an assault that sharply escalated already-high tensions after weeks of religious violence.

The attack during morning prayers in the west Jerusalem neighborhood of Har Nof was carried out by two Palestinian cousins wielding meat cleavers, knives and a handgun. They were shot to death by police after the deadliest assault in the holy city since 2008.

Four of the dead were rabbis and one was a police officer who died of his wounds hours after the attack. Three of the rabbis were born in the United States and the fourth was born in England, although all held dual Israeli citizenship. Five others were wounded.

Palestinian President Mahmoud Abbas condemned the attack, the first time he has done so in the wave of deadly violence against Israelis. But he also called for an end to Israeli "provocations" surrounding Jerusalem's shrines that are sacred to both Muslims and Jews.

President Barack Obama called the attack "horrific" and without justification, urging cooperation from both sides to ease tensions and adding that too many Israelis and Palestinians have died in recent months,

Tuesday's attack, however, appeared to mark a turning point, with the gruesome scene in a house of worship shocking a nation long accustomed to violence.

The government released a photo of a meat cleaver it said came from the crime scene. Government video showed blood-soaked prayer books and prayer shawls in the synagogue. A pair of glasses lay under a table, and thick streaks of blood smeared the floor.

"I saw people lying on the floor, blood everywhere," said Yosef Posternak, who was at the synagogue in the quiet neighborhood that has a large community of English-speaking immigrants.

"People were trying to fight with (the attackers) but they didn't have much of a chance," Posternak told Israel Radio.

In one of Israel's first acts of retaliation, Prime Minister Benjamin Netanyahu ordered the demolitions of the homes of the attackers. But halting further violence could prove to be a tough challenge as police confront a new threat: Lightly armed assailants from annexed east Jerusalem who hold residency rights that allow them to move freely throughout the country.

Netanyahu condemned the deaths of the "innocent and pure Jews." In a nationally televised address, he accused Abbas of inciting the recent violence and said the Palestinian leader's condemnation of the attack was insufficient.

Hamas, the militant Palestinian group that runs the Gaza Strip, praised the attack. In Gaza, dozens celebrated in the streets, with some offering trays full of candy.

The U.S.-born victims were identified as Moshe Twersky, 59, Aryeh Kupinsky, 43, and Kalman Levine, 55. The Israeli Foreign Ministry said the British man was Avraham Goldberg, 68, who immigrated to Israel in 1993.

It described the four as "rabbis," an honorific title in the ultra-Orthodox world given to men who are considered pious and learned. Twersky, a native of Boston, was the head of the Toras Moshe Yeshiva, a seminary for English-speaking students. He was the son of Rabbi Isador Twersky, founder of Harvard University's Center for Jewish Studies, and a grandson Rabbi Joseph B. Soloveitchik, a luminary in the world of modern Orthodox Jewry.

Thousands of people attended a joint funeral for Kupinsky, Levine and Goldberg before sundown- held outside the synagogue where they were killed.

In recent weeks, Jerusalem has seen its worst sustained bout of violence since a Palestinian uprising a decade ago. Palestinian assailants have carried out a pair of deadly attacks by ramming their cars into crowded train stations, while a gunman shot and seriously wounded a Jewish activist who has campaigned for greater access to the holy site.

The hilltop compound, in Jerusalem's Old City, has been at the heart of the tensions. It is revered by Jews as the Temple Mount, the site of the ancient Hebrew temples. For Muslims, it is the Noble Sanctuary, home to the Al-Aqsa Mosque and the iconic gold-topped Dome of the Rock.

Under a longstanding arrangement, Jews are permitted to visit but not to pray. A growing number of visits by Jewish worshippers, many who seek the right to pray there, has drawn Muslim accusations that Israel is secretly trying to take over the site and sparked violent clashes between young Palestinians and Israeli police.

Netanyahu has repeatedly said he will not change that arrangement, but the violence has spread beyond Jerusalem, with deadly stabbings in Tel Aviv and the West Bank last week, while the fatal shooting of a young Arab protester in northern Israel by police - apparently as he was walking away from an officer - has added to the tensions.

Police identified the synagogue attackers as Ghassan and Oday Abu Jamal, cousins from the Jabal Mukaber neighborhood in east Jerusalem.

Police spokesman Micky Rosenfeld said the assailants were killed in a shootout with police that left one officer critically wounded. He said police were still trying to determine how the men had chosen their target.

Mohammed Zahaikeh, a social activist in Jabal Mukaber, said he did not know whether the cousins were politically active. He said Ghassan was 27, married with two young children and worked in a clothing store. Oday, 21, was not married and was an interior decorator. He said both men were quiet, and residents were surprised by the attack.

Clashes later broke out outside the assailants' home, where dozens of police officers had converged. Residents hurled stones at police, who responded with tear gas and stun grenades. Residents said 14 members of the Abu Jamal family were arrested.

The violence has created a special security challenge for Israel. Where Palestinian violence has traditionally been carried out by organized militant groups based in the West Bank or Gaza, most of the recent attacks have been done by perpetrators from east Jerusalem acting on their own.

Israel captured east Jerusalem in the 1967 Mideast war and later annexed the area, while the Palestinians claim it as their capital. Although the annexation is not internationally recognized, the more than 200,000 Arab residents of east Jerusalem have Israeli residency rights that allow them to move freely throughout the country. In contrast, West Bank residents and Gazans need Israeli permission to enter.

"There is no solution in the world of intelligence to the problem of a lone wolf who decides in the morning to launch an attack in the afternoon," said Cabinet Minister Yaakov Peri, a former director of the Shin Bet internal security agency.

He said the "only solution is very strong deterrence," such as swiftly demolishing the homes of attackers.

Netanyahu has vowed to revive the policy of home demolitions, which Israel halted in 2005 after determining it wasn't an effective deterrent. Israeli officials have reversed their opinion, and Netanyahu has ordered stepped-up demolitions.

The Israeli leader flew to Jordan last week for talks with King Abdullah II, who holds custodial rights over the Jerusalem mosque compound.

The two men agreed to take steps to lower tensions at the holy site. But on Monday, rumors spread that a Palestinian bus driver had been killed by Jewish assailants. Although forensics experts ruled the death a suicide, Palestinian youths clashed with Israeli police.

Israeli media reported Tuesday that Yoram Cohen, the current Shin Bet head, told lawmakers in a closed meeting that Abbas was not interested in inciting Palestinians to use violence against Israelis.

Cohen tied his assertion to his belief that widespread Palestinian violence against Israelis would undermine Abbas's political standing, the reports said.

The attack was the deadliest in Jerusalem since a Palestinian assailant killed eight students at a Jewish seminary in March 2008.