Israeli prime minister Benjamin Netanyahu has promised a heavy-handed response after two Palestinians attacked a Jerusalem synagogue with a gun and meat cleavers, killing four rabbis and wounding eight others.

Three of the victims held dual US-Israeli citizenship and the 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.

Mr Netanyahu repeated accusations that the head of the Palestinian Authority, Mahmoud Abbas, incited the attack and promised to destroy the homes of those responsible.

"This is a direct result of incitement led by Hamas and Abu Mazen, incitement that the international community has been irresponsibly ignoring," he said.

"We will respond with a heavy hand to the brutal murder of Jews who came to pray and were killed by lowly murderers."

Israeli security personnel run next to the synagogue where the attack took place in Jerusalem ( Reuters: Ronen Zvulun )

Mr Abbas condemned the attack, which came after weeks of unrest fuelled 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.

"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," he said in a statement.

A worshipper in the Kehillat Bnei Torah synagogue in an ultra-Orthodox neighbourhood 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.

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.

Their family said they were reacting to the heavy Israeli presence in East Jerusalem which Israel conquered in 1967 and subsequently effectively annexed despite international opposition.

They said the attackers were motivated by an ongoing feeling of oppression by the Israelis.

Israel at the height of ongoing terror attack: Netanyahu

Four extra paramilitary police battalions will be deployed in Jerusalem and a recruitment drive targeting citizens with firearm licences was underway to bolster Jerusalem's civil guard, but Mr Netanyahu also sought to calm tempers, warning Israelis not to take the law into their own hands.

"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," Mr Netanyahu said.

"We are in a long campaign in a war against terrorism. There are some who want to uproot us from our state and capital. They will not succeed. We are in a battle over Jerusalem, our eternal capital.

"This evening, I ordered the destruction of the houses of the Palestinians who carried out this massacre and to speed up the demolition of those who carried out previous attacks," he said, reiterating a pledge made on November 6 just days after a Palestinian rammed his car into pedestrians, killing two in the second such hit-and-run attack in a fortnight.

"Citizen of Israel, I call on you to demonstrate great vigilance and to respect the law because the state will bring to justice all the terrorists and those who dispatch them."

Mr Netanyahu promised to destroy the homes of those responsible. ( Reuters: Baz Ratner )

Israel would also "step up enforcement and harshen the penalties" against anyone or any organisation involved in incitement, he said.

A secular Palestinian militant group claimed responsibility for the attack, but their involvement could not be confirmed and Israeli officials said initial investigations found no link to an organisation.

Mr Netanyahu linked the attack to inflammatory statements about the flashpoint Al-Aqsa mosque compound made by the Palestinian Authority, the Islamist Hamas movement and Israel's Islamic Movement, a religious advocacy group.

Known to Jews as the Temple Mount, the compound is sacred to both faiths and one of the most sensitive sites in the Middle East.

"Hamas, the Islamic Movement and the Palestinian Authority are spreading no end of libels... against the state of Israel," he said.

"They say that the Jews are defiling the Temple Mount, they say that we are planning to destroy the holy places there, that we are intending to change the prayer rites there.

"It's all a lie. And these lies have already cost a very high price," he said, listing the Israeli victims of recent Palestinian attacks in Jerusalem.

"Today more victims were added to their number due to this crazy blood libel."

But Palestinian officials have blamed Mr Netanyahu for provoking the explosion of religious violence in which Israelis and Palestinians have died.

Barack Obama condemns 'outrageous' attack

US 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 US citizens Aryeh Kupinsky, Cary William Levine and Mosheh Twersky, and injured several more."

Speaking to reporters at the White House, the president said the "outrageous" acts represent a dangerous extremism "that threatens to bring all of the Middle East into a kind of spiral from which it's very difficult to emerge".

"Too many Israelis have died, too many Palestinians have died, and at this critical time it is important for Palestinians and Israelis to work together to lower tensions and to reject violence."

US-brokered peace talks collapsed in April after Mr 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.

Israeli police check the car of the suspected attackers. ( ABC: Matt Brown )

ABC/wires