The people killed in a Jerusalem synagogue attack are three American citizens and a Briton, Israeli police say.

Police said the victims were all immigrants to Israel and held dual citizenship.

A pair of Palestinian attackers burst into a synagogue during morning prayers with meat cleavers and a gun, killing four people before they were shot dead by police.

The attack occurred in Jerusalem's Har Nof neighbourhood, an ultra-Orthodox area with a large number of immigrants from Western countries.

Prime Minister Benjamin Netanyahu vowed that Israel will "respond harshly" to the attack, describing it as a "cruel murder of Jews who came to pray and were killed by despicable murderers".

US secretary of state John Kerry said he spoke to Mr Netanyahu after the assault and denounced it as an "act of pure terror and senseless brutality and violence".

Palestinian president Mahmoud Abbas condemned the attack, the first time he has done so since a recent spike in deadly violence against Israelis began. He also called for an end to Israeli "provocations" surrounding the sacred site.

In a statement, his office said he "condemns the killing of the worshippers in a synagogue in west Jerusalem". The statement called for an end to the "invasion" of the mosque at the holy site and a halt to "incitement" by Israeli ministers.

Israeli police called the incident a terrorist attack and said the two Palestinian assailants were cousins from east Jerusalem. The Popular Front for the Liberation of Palestine, a militant group, said the cousins were its members.

A PFLP statement did not specify whether the group instructed the cousins to carry out the attack. Hamas, the militant Palestinian group that runs the Gaza Strip, praised the attack.

Police spokesman Micky Rosenfeld said six people were also wounded in the attack, including two police officers. Four of the wounded were reported to be in a serious condition. He said police were searching the area for other suspects.

Footage from the scene showed the synagogue, in Jerusalem's ultra-Orthodox Har Nof area, surrounded by police and rescue workers following the attack.

Wounded worshippers were being assisted by paramedics and a bloodied butcher's knife lay near the scene of the attack.

A man named only as Yossi, who was praying at the synagogue at the time of the attack, told Israeli Channel 2 TV: "I tried to escape. The man with the knife approached me. There was a chair and table between us ... my prayer shawl got caught. I left it there and escaped."

Yosef Posternak, who was also at the synagogue, told Israel Radio that about 25 worshippers were inside when the attackers entered.

"I saw people lying on the floor, blood everywhere. People were trying to fight with (the attackers) but they didn't have much of a chance," he said.

A photo in Israeli media from inside the synagogue showed what appeared to be a body on the floor draped in a prayer shawl, with blood nearby.

Police spokeswoman Luba Samri said the attackers were Palestinians from east Jerusalem, which has been the scene of relentless clashes between Israeli police and Palestinian protesters in recent months. She identified the assailants as Ghassan and Oday Abu Jamal from the Jabal Mukaber neighborhood.

Soon after the attack, dozens of police officers gathered outside the Abu Jamals' home. Ms Samri said this was part of the police investigation. She said residents threw stones at the police officers and that police have made arrests in connection with the attack.

Israel has been on edge with a spate of attacks by Palestinians against Israelis, killing at least six people in Jerusalem, the West Bank and Tel Aviv in recent weeks.

Jerusalem residents had already been fearful of what appeared to be lone wolf attacks using cars or knives against pedestrians, but the synagogue assault harks back to gruesome attacks during the Palestinian uprising of the last decade.

Israel's police chief said it was likely not organized by militant groups, similar to other recent incidents, making it more difficult for security forces to prevent the violence.

"These are individuals who decide to do horrible acts. It's very hard to know ahead of time about every such incident," Yohanan Danino said.

Tensions appeared to have been somewhat defused last week following a meeting between Mr Netanyahu, Mr Kerry and Jordan's King Abdullah II in Amman. The meeting was an attempt to restore calm after months of violent confrontations surrounding a sacred shrine holy to both Jews and Muslims.

Israel and the Palestinians said then they would take steps to reduce tensions that might lead to an escalation.

In his statement, Mr Netanyahu blamed the violence on incitement by both Hamas and Mr Abbas. He said the international community ignores the incitement.

Mr Kerry blamed the attack on Palestinian calls for "days of rage" and said Palestinian leaders must take serious steps to refrain from such incitement. He also urged them to condemn the attack "in the most powerful terms".

"Innocent people who had come to worship died in the sanctuary of a synagogue. They were hatched, hacked and murdered in that holy place in an act of pure terror and senseless brutality and murder," he said.

Hamas' statement praised the synagogue attack, saying it was a "response to continued Israeli crimes, the killing, desecrating al-Aqsa (mosque)", a reference to a recent incident at the holy site.

In Gaza, dozens of people took to the streets to celebrate the attack. Some people held trays full of sweets and distributed them to drivers and passers-by.

In the southern town of Rafah, women and schoolchildren waved green Hamas flags and a loudspeaker praised the attack.

Soon after the attack, clashes broke out outside the Abu Jamals' home, where dozens of police had converged. Residents hurled stones at police who responded using riot dispersal weapons.

Residents in the neighbourhood said 14 members of the Abu Jamal family were arrested.

Mohammed Zahaikeh, a social activist in Jabal Mukaber, said one of the relatives of the cousins, Jamal Abu Jamal, was released in a 2011 prisoner swap and re-arrested recently by Israeli police.

Mr Abbas, at a meeting later with security officials, called for calm.

"We call for a complete calm and a halt to all these attacks to enable us to move ahead with our political work," he said, according to the Palestinian official Wafa news agency.

Much of the recent violence stems from tensions surrounding the Jerusalem holy site referred to by Jews as the Temple Mount because of the Jewish temples that stood there in biblical times. It is the most sacred place in Judaism; Muslims refer to it as the Noble Sanctuary, and it is their third holiest site, after Mecca and Medina in Saudi Arabia.

The site is so holy that Jews have traditionally refrained from going there, instead praying at the adjacent Western Wall. Israel's chief rabbis have urged people not to ascend to the area but in recent years, a small but growing number of Jews, including ultra-nationalist politicians, have begun regularly visiting the site, a move seen as a provocation.

The FBI routinely investigates attacks abroad in which US citizens are killed and is expected to be involved in this investigation, a US official in Washington said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.