An attack by two Palestinian men on a synagogue in West Jerusalem has claimed the lives of five Israelis and injured eight others.

The Palestinian attackers, who police said were armed with a gun and axes, were shot dead by police after gaining entrance to the Har Nof Synagogue on Tuesday morning.

Following the incident, tens of Palestinians were injured in confrontations with Israeli settlers and security forces in both Jerusalem and the occupied West Bank.

Mark Regev, a spokesman for Israeli PM, and Sabri Saidam, the deputy head of the Fatah Revolutionary Council, discuss the deadly synagogue attack

In response to the attack, Israel's Prime Minister Benjamin Netanyahu, who had warned of a "harsh response," ordered the demolition of the homes of the two Palestinians who carried out the attack.

Netanyahu said that Hamas, the Palestinian faction that governs the Gaza Strip, had spread lies that Israel was trying to take control of a religious site in occupied East Jerusalem, called Temple Mount by Israelis and Haram al-Sharif by Arabs.

"This caused the attacks," Netanyahu said. "There is no end to their [Hamas's] terror against the state of Israel."

Palestinians are angry at what they say are repeated attempts by right-wing Jews to extend their influence at the Muslim-run Haram al-Sharif, which houses the Al-Aqsa mosque. The compound is also considered by Jews to be a holy site.

Earlier, Palestinian President Mahmoud Abbas condemned the killings while Hamas said it was "a natural reaction to Israel's practices" against Palestinians.

'Stun grenades'

The assailants have been identified as Odai and Ghasan Abu Jamal, cousins from East Jerusalem.
 
The two men belong to the Palestinian group known as the Popular Front for Liberation of Palestine (PFLP).

Everyone expected this to happen. Jerusalem is boiling. Yesterday, the Israeli forces demolished the houses of the Palestinians who attacked Israelis but they never punish Israeli attackers.

Ghazi Hamad, senior Hamas official

A statement from the PFLP's armed wing welcomed the attack, but stopped short of taking responsibility for or directly organising it.

Four of the five Israelis killed were rabbis. A policeman later died of wounds sustained in the attack.

Later on Tuesday, Israeli police confirmed to Al Jazeera that a Palestinian man has been stabbed in the leg in the north of Jerusalem. Fadi Radwan was stabbed near al-Musrara and taken to the hospital.

Israel raised the security threat across the country following the Tuesday's attack.

The latest violence came after months of tension between Israelis and Palestinians in Jerusalem, which is divided between a largely Arab east and a mostly Jewish west.

Late on Sunday, a Palestinian bus driver was found hanged in the vehicle. Israeli police said he killed himself, but his family and colleagues believe he was killed by Jewish settlers.

At least six Israelis have been killed in a spate of other attacks over the past few weeks.

Obama condemnation

US President Barack Obama condemned the synagogue attack, calling on Israeli and Palestinian leaders to lower tensions and seek peace.

"I strongly condemn today's terrorist attack on worshipers at a synagogue in Jerusalem," Obama said in a statement. 

Live Box 20141030164529962703

"At this sensitive moment in Jerusalem, it is all the more important for Israeli and Palestinian leaders and ordinary citizens to work cooperatively together to lower tensions, reject violence, and seek a path forward towards peace."

Ghazi Hamad, a senior Hamas official, told Al Jazeera: "Everyone expected this to happen. Jerusalem is boiling.

"Yesterday [Monday], the Israeli forces demolished the houses of the Palestinians who attacked Israelis, but they never punish Israeli attackers. We are expecting more violence."

In recent weeks, Jerusalem has seen a number of confrontations, which have sometimes turned deadly, around the flashpoint al-Aqsa Mosque in the eastern side of the city.

Israeli forces have repeatedly imposed restrictions on Muslim worshippers trying to pray there.