Three Arabs opened fire on Israeli police in Jerusalem Friday, killing two before fleeing to an ultra-sensitive holy site where they too were shot dead in one of the city's most serious incidents in recent years.
Palestinian president Mahmud Abbas and Israeli Prime Minister Benjamin Netanyahu spoke by phone later as tensions rose over the attack and its aftermath.
Israeli authorities also detained Jerusalem's top Islamic cleric as crowds gathered at the Old City's gates after the attack, his son said.
The three attackers, Arab Israelis aged between 19 and 29, were shot dead by police. A body could be seen on the ground near the Al-Aqsa mosque at the site in Jerusalem's Old City.
Police recovered two locally made automatic rifles, a pistol and a knife, police spokesman Micky Rosenfeld told AFP.
Videos posted on social media showed a hail of gunfire ring out in what seemed to be an exchange between Israeli security forces and the assailants.
Security forces locked down the area and in a highly unusual move the Al-Aqsa mosque was closed to Friday prayers after the attack.
The attackers were from the Arab Israeli city of Umm al-Fahm near the occupied West Bank.
Police identified them as Muhammad Ahmad Muhammad Jabareen, 29; Muhammad Hamed Abdel Latif Jabareen, 19; and Muhammad Ahmad Mafadal Jabareen, 29.
Arab Israelis are descendants of Palestinians who remained on their land following the creation of Israel in 1948. They largely identify with the Palestinian cause.
The police who were killed were Ha'il Satawi, 30, and Kamil Shanan, 22, both from the Druze minority.
The assailants were killed at the site known to Muslims as the Haram al-Sharif and to Jews as the Temple Mount, the scene of regular clashes between Palestinians and Israeli police, but where gunfire rarely occurs.
The site includes the Al-Aqsa mosque and the Dome of the Rock.
In the phone call with Netanyahu, Abbas "expressed his strong rejection and condemnation of the incident at the blessed Al-Aqsa mosque and his rejection of any act of violence from any side, especially in places of worship", official Palestinian news agency WAFA said.
The statement appeared stronger than previous such responses from Abbas, who has repeatedly called for non-violent resistance to Israel's occupation without specifically condemning Palestinian attacks.
A statement from Netanyahu's office confirmed the call.
"The prime minister said that Israel will take all the necessary measures in order to ensure the security on the Temple Mount without changes in the status quo," it said.
Israeli Public Security Minister Gilad Erdan called it an "extremely severe event which crossed all red lines".
- Mosque closed -
With Al-Aqsa closed, crowds gathered at Old City gates and held prayers there.
The grand mufti of Jerusalem Muhammad Ahmad Hussein, the city's highest Islamic authority, condemned the closure of the mosque compound for prayers.
"I have very little information about it, but it doesn't mean you should close the mosque for prayers," he told journalists at the Lions Gate entrance to the Old City, near the holy site.
According to his son Jihad Hussein, he was later detained by Israeli police who declined to comment.
Hamas, the Islamist movement that runs the Gaza Strip, called the attack "a natural response to the Zionist terrorism and the desecration of the Al Aqsa mosque", referring to previous Israeli raids at the site.
UN Middle East envoy Nickolay Mladenov said on Twitter that "places for worship are for prayer, not for violence. All must take a stand against terror & condemn it."
Basem Badawi, 60, a water-seller in the Old City, told AFP: "I was standing here and then I heard the shooting. I thought it was fireworks.
"But then I saw the police coming from everywhere."
- Flashpoint site -
The Haram al-Sharif/Temple Mount is considered the third-holiest site in Islam and the most sacred in Judaism.
It is central to the Israeli-Palestinian conflict, with Palestinians fearing Israel may one day seek to assert further control over it.
It is located in east Jerusalem, occupied by Israel in the 1967 Six-Day War and later annexed in a move never recognised by the international community.
Jews are allowed to visit, but not pray there to avoid provoking tensions.
The site is administered by the Islamic Waqf organisation. Waqf officials said Israeli police detained its guards there after the attack.
A wave of unrest that broke out in October 2015 has claimed the lives of at least 281 Palestinians or Arab Israelis, 44 Israelis, two Americans, two Jordanians, an Eritrean, a Sudanese and a Briton, according to an AFP toll.
Israeli authorities say most of the Palestinians killed were carrying out knife, gun or car-ramming attacks.
Others were shot dead in protests and clashes, while some were killed in Israeli air strikes on the Gaza Strip.
The violence had greatly subsided in recent months.